Schooner.Error exception (schooner v1.0.0)

Copy Markdown View Source

Host-side exception raised when a Scheme raise / raise-continuable / error is not caught by any installed with-exception-handler or guard. The struct carries the original Scheme value verbatim in :value; for an error object the host can pattern-match {:error_obj, kind, message, irritants} directly, or use irritants/1 for the common case.

This is distinct from Schooner.Eval.Error and Schooner.Primitive.Error, which signal evaluator/primitive failures that the host gets directly without crossing the Scheme exception machinery. Phase 11 only routes explicit raise calls through here; evaluator/primitive errors continue to propagate as before.

Summary

Functions

Return the irritants of error's wrapped value when it is an error object; [] for any other raised value.

Types

t()

@type t() :: %Schooner.Error{
  __exception__: true,
  message: binary() | nil,
  value: Schooner.Value.t()
}

Functions

irritants(error)

@spec irritants(t()) :: [Schooner.Value.t()]

Return the irritants of error's wrapped value when it is an error object; [] for any other raised value.