Skip to main content

Module failure

Module failure 

Source
Expand description

Where a failure ends: the program, or the boundary that catches it.

A generated program reports a runtime failure in its panic hook and ends with exit status 1, as every tier does. A failure inside a served request, or inside a task the replay scheduler polls, ends there instead: the server answers 500 and keeps serving, the scheduler fails the task and runs its peers. Every place the runtime catches a panic does it through caught, and the hook asks is_caught before it ends the process.

Functionsยง

caught
Run f, catching a panic it raises; while it runs, is_caught answers true on this thread.
is_caught
Whether a panic raised on this thread now ends at an enclosing caught rather than ending the program. Never in a build that aborts on panic, where no boundary can catch one.