Error handling, exceptions.

IErrorHandleable

Available since version 1.0 (view source)

not referred automatically

PROTOCOL with methods -error-handler, -error-mode

A state protocol for custom error handling of references, resources, etc. Corresponding keyword options are :error-handler and :error-mode.

-error-handler

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (-error-handler this)

Type signature:
  • (Any) → IReference

Returns reference to the current error handler. Referenced value is nil if no error handler is set.

See also: IErrorHandleable

-error-mode

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (-error-mode this)

Type signature:
  • (Any) → IReference

Returns reference to the current error mode. Referenced value is nil if no error mode is set.

See also: IErrorHandleable

IException

Available since version 1.0 (view source)

MARKER PROTOCOL

extensions of this protocol on existing types are forbidden (performance and/or backwards compatibility reasons).

An abstract type protocol for exceptions.

See also: exception?, throw, try, catch

IFailAware

Available since version 1.0 (view source)

not referred automatically

PROTOCOL with method -error

An auxiliary state protocol for objects that can be in a failed state.

See also: fail-aware?, error

-error

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (-error this)

Type signature:
  • (Any) → (Maybe IException)

Returns exception which has caused this to fail. Returns nil if object is not failed.

See also: IFailAware

IFailable

Available since version 1.0 (view source)

not referred automatically

PROTOCOL with method -fail!

An auxiliary state protocol for object’s failed state that can be reported from outside.

See also: fail!

-fail!

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (-fail! this exception)

Type signature:
  • (Any ⨯ IException) → nil

Reports a failed state to the failable object. Returns nil.

See also: IFailable