Skip to main content

ErrorValue

Trait ErrorValue 

Source
pub trait ErrorValue:
    Send
    + Sync
    + Debug {
    // Required methods
    fn type_name(&self) -> &str;
    fn display(&self) -> String;

    // Provided methods
    fn structural_props(&self) -> Vec<(&'static str, String)> { ... }
    fn as_any(&self) -> Option<&dyn Any> { ... }
}
Expand description

Minimal view of a Bock error that the adaptive handler needs.

type_name + structural_props feed the pin key per Q6 of the 2026-04-20 spec amendment. display feeds the provider prompt and the ErrorOccurrence history.

Required Methods§

Source

fn type_name(&self) -> &str

Stable type name, e.g., "ConnectionTimeout".

Must not include value-dependent information.

Source

fn display(&self) -> String

Human-readable rendering for logs and provider prompts.

Provided Methods§

Source

fn structural_props(&self) -> Vec<(&'static str, String)>

Structural properties that affect recovery choice.

Example for an HTTP error: [("status_class", "5xx")]. Per Q6 these are the properties that discriminate recovery decisions — value-level fields like an exact timeout duration are intentionally excluded so ConnectionTimeout{after: 30s} and ConnectionTimeout{after: 45s} pin together.

Source

fn as_any(&self) -> Option<&dyn Any>

Escape hatch for strategies that need the raw error, e.g., to unwrap it back into the interpreter’s Value::Error. Default returns None.

Implementors§