Skip to main content

Module errors

Module errors 

Source
Expand description

Structured runtime errors (ISO error terms).

An error is carried as a relocatable ball (TermBuf) so it survives the heap rewinding that unwinds to a catch frame, plus a pre-rendered message for top-level output. The message format is v1’s format_term rendering of the ball — byte-compatible with the M2/M3 preformatted strings.

Functions§

domain_error
domain_error(Domain, Culprit)
evaluation
evaluation_error(Kind)
existence_procedure
existence_error(procedure, Name/Arity) with v1’s exact context. Source provenance (SPANS.md Layer 3) comes from m.error_site, appended by set_formal — the caller sets that around the raise.
instantiation
instantiation_error
resource
resource_error(Kind) — the steps variant is uncatchable (v1 rule).
set_formal
Build error(Formal, 'Context'), snapshot it, and set m.error. The formal term is built on the heap transiently and trimmed back.
throw_term
throw/1 of an arbitrary user term: the ball IS the term; the top-level message is its rendering (v1 runner behavior).
type_error
type_error(Type, Culprit)