Handling Errors Deterministically

Use with-exception-handler for procedural handling and guard for condition-style matching over catchable error objects.

At a glance

LISPEX
(guard (e ((error-object? e) (error-object-message e))) (error "bad input"))

Result

OUTPUT
"bad input"

Working method

  • raise-continuable returns the handler result to the raise site; non-continuable raise cannot return normally.
  • Inspect error objects with the documented predicates/accessors rather than parsing rendered diagnostic text.
  • When no guard clause matches, the original fault is reraised unchanged.

Boundaries

  • ResourceLimit is not catchable, and host crashes are never converted into friendly guest errors.