class X::OutOfRange
src
class X::OutOfRange is Exception { }
General error when something (for example an array index) is out of an allowed
range.
For example
say 42[2]
dies with
Index out of range. Is: 2, should be in 0..0
since scalars generally act as a one-element list.
Methods
what
method what() returns Str:D
Verbal description of the thing that was out of range (e.g. "array index" ,
"month" ).
got
method got()
Returns the object that was considered out of range (often an integer)
range
method range returns Range:D
Returns a L<Range> object describing the premissible range for the object
returned from .got .
comment
method comment returns Str
Returns an additiona comment that is included in the error message.