txt: ## outofrange.md
  class X::OutOfRange
  
  Error due to indexing outside of an allowed range
  
  ```raku
  class X::OutOfRange is Exception { }
  ```
  
  General error when something (for example an array index) is out of an allowed range.
  
  For example
  
  ```raku
  say 42[2];
  CATCH { default { put .^name, ': ', .Str } };
  # OUTPUT: «X::OutOfRange: Index out of range. Is: 2, should be in 0..0␤»
  ```
  
  since scalars generally act as a one-element list.
  
  # [Methods](#class_X::OutOfRange "go to top of document")[§](#Methods "direct link")
  
  ## [method what](#class_X::OutOfRange "go to top of document")[§](#method_what "direct link")
  
  ```raku
  method what(--> Str:D)
  ```
  
  Verbal description of the thing that was out of range (e.g. `"array index"`, `"month"`).
  
  ## [method got](#class_X::OutOfRange "go to top of document")[§](#method_got "direct link")
  
  ```raku
  method got()
  ```
  
  Returns the object that was considered out of range (often an integer)
  
  ## [method range](#class_X::OutOfRange "go to top of document")[§](#method_range "direct link")
  
  ```raku
  method range(--> Range:D)
  ```
  
  Returns a [`Range`](/type/Range) object describing the permissible range for the object returned from `.got`.
  
  ## [method comment](#class_X::OutOfRange "go to top of document")[§](#method_comment "direct link")
  
  ```raku
  method comment(--> Str)
  ```
  
  Returns an additional comment that is included in the error message.
  