ErrorThe root of every throwable error: a human-readable message plus an optional payload. Subclass it for your own error types (Error <- MyError <- {}) and catch by type with block.catch:{ |e:MyError| ... }.
Convenience constructor that builds an instance and immediately throws, e.g. TypeError.throw:'expected an Integer'. Inherited by subclasses.
Like throw:, also attaching a payload value the handler can read back.
{ Error.throw:'no key' payload:#missing } .catch:{ |e:Error| e.payload } "* -> missing
The human-readable description this error was thrown with.
The value attached at the throw site (throw:payload:), or nil.
Renders as class name and message.
{ TypeError.throw:'nope' }.catch:{ |e:TypeError| e.s } "* -> TypeError: nope