Skip to main content

Module error

Module error 

Source
Expand description

EngineError: crate::tui_client::CodeEngine’s unified error type.

Why: CodeEngine’s TuiEngine methods return anyhow::Result (the trait’s signature, crates/trusty-code-tui/src/engine.rs), but the engine’s own internal helpers need a concrete, matchable error type — both so tests can assert on WHICH failure occurred (discovery vs. transport vs. an RPC error envelope) and so ? composes cleanly across the discovery/rpc/sse submodules before the outer TuiEngine method converts the final error into anyhow::Error (automatic via anyhow’s blanket From<E: std::error::Error> impl). What: one variant per failure class this client can observe: daemon discovery failure, an HTTP-transport-level failure (DNS/connect/decode), a non-2xx HTTP status without a JSON-RPC error envelope (e.g. 502), a JSON-RPC error envelope from the daemon, and “no active session” (a caller-usage error, not a transport one — handle_input before setup completed). Test: exercised indirectly through every tui_client submodule’s own tests and tests/tui_client_engine.rs.

Enums§

EngineError
See module docs.