PkmnLib.NET/PkmnLib.Static/Utils/Errors/OutOfRange.cs

14 lines
387 B
C#
Raw Normal View History

2024-07-20 11:51:52 +00:00
namespace PkmnLib.Static.Utils.Errors;
2024-07-20 14:12:39 +00:00
/// <summary>
/// A result that indicates an index is out of range.
/// </summary>
2024-07-28 10:52:17 +00:00
public class OutOfRangeException : Exception
2024-07-20 11:51:52 +00:00
{
2024-07-28 10:52:17 +00:00
/// <inheritdoc cref="OutOfRangeException"/>
public OutOfRangeException(string hint, int index, int max)
2024-07-20 11:51:52 +00:00
: base($"{hint} index {index} is out of range. Must be between 0 and {max - 1}.")
{
}
}