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 and so ? composes cleanly
across the client’s 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 over the
daemon’s Unix socket (#6637): a transport-level failure, a JSON-RPC error
envelope, a response whose shape this client did not expect, an event
stream that ended without a terminal session event, and “no active session”
(a caller-usage error, not a transport one — handle_input before setup
completed).
The HTTP-shaped variants are gone with the transport. Discovery went with
TCODE_DAEMON_URL and the http_addr file — the socket path is derived,
not discovered. Status went with HTTP status codes, which a framed
JSON-RPC response does not have: every daemon-side refusal now arrives as
EngineError::Rpc carrying a code, and every transport failure as
EngineError::Transport.
Test: exercised indirectly through every tui_client submodule’s own
tests and tests/tui_client_engine.rs.
Enums§
- Engine
Error - See module docs.