Skip to main content

err_code_and_message

Function err_code_and_message 

Source
pub fn err_code_and_message(err: &EngineError) -> (String, String)
Expand description

Maps an EngineError to the (code, message) pair scripts and batch consumers see when a script fails — code is a kebab-case symbol (matching the wire envelope’s :code slot for catch-each cells and server::script per-tx reports), message is the engine’s own diagnostic string.

Engine-bound deadlines (OutOfFuel, EpochInterrupt) also have a mapping here so callers that do want to surface them to scripts (batch runners that don’t care about catch-each’s “engine deadlines aren’t catchable” rule) can. catch-each filters the deadlines out before reaching this mapper.