← index

IndexError

inherits Error · defined at core/00-bootstrap.qn:169

Raised by an out-of-bounds index (e.g. List.at:put:, Bytes.at:). The VM populates index (the offending index) and length (the collection's size) so a handler can report or recover without parsing the message.

Instance methods

index

The out-of-range index the operation was asked for.

{ #(1 2).at:9 put:0 }.catch:{ |e:IndexError| e.index }    "* -> 9

core/00-bootstrap.qn:175

length

The receiver's length at the time of the failure.

core/00-bootstrap.qn:177