You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
namespace CoreLibrary.Exceptions
|
|
{
|
|
/// <summary>
|
|
/// Exception levée lorsqu'un indice de jeton est invalide.
|
|
/// </summary>
|
|
[Serializable]
|
|
public class IndiceCodeException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Initialise une nouvelle instance de la classe <see cref="IndiceCodeException"/>.
|
|
/// </summary>
|
|
/// <param name="indice">L'indice incorrect qui a été spécifié.</param>
|
|
/// <param name="indiceMax">L'indice maximum permis.</param>
|
|
private const string messageDefaut = "L'indice du jeton que vous essayez de récupérer est hors de la plage valide.";
|
|
|
|
public IndiceCodeException() : base(messageDefaut)
|
|
{ }
|
|
|
|
public IndiceCodeException(int indice, int indiceMax) :
|
|
base($"Vous avez essayé de récupérer le jeton à la place {indice}, mais son indice doit être compris entre 0 et {indiceMax}.")
|
|
{ }
|
|
|
|
public IndiceCodeException(string message) : base(message)
|
|
{ }
|
|
|
|
public IndiceCodeException(string message, Exception exception) : base(message, exception)
|
|
{ }
|
|
}
|
|
}
|