Skip to main content

failure_message

Function failure_message 

Source
pub fn failure_message(error: &Error) -> String
Expand description

The one-line text for a run’s failure: the header render puts above the frames, and what a caller prints when render has no frames to show.

Most engine messages already say what the program did (null reference, cast failure, out of bounds array access) and are used verbatim. These three name an engine mechanism instead — interrupt and all fuel consumed by WebAssembly tell a reader nothing they can act on, and leak the host into a diagnostic that is supposed to be about their code.

Deliberately not the same table as [trap_label_for]: a stack overflow reads better as the engine’s call stack exhausted in the header (it says what happened) and as stack overflow in the frame label (it names the frame).