← index

IoError

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

Raised by socket/stream/file operations. kind is a symbol categorizing the failure — #connectionRefused, #connectionReset, #timedOut, #unexpectedEof, #notFound, #closed (a closed/consumed handle), … — so a handler can branch on the cause without parsing the message. The VM populates kind when it raises (see src/error.rs IoErrorKind); from Quoin, use IoError.throw:msg kind:k (the inherited bare throw: / throw:payload: leave kind nil).

Class methods

throw: kind:

Build and throw with kind set.

{ IoError.throw:'refused' kind:#connectionRefused }
    .catch:{ |e:IoError| e.kind }    "* -> connectionRefused

core/00-bootstrap.qn:251

Instance methods

kind

The failure category as a symbol (#notFound, #timedOut, #closed, …), or nil for a Quoin-side throw: that didn't set one.

core/00-bootstrap.qn:256