pub enum EngineError {
Discovery(DiscoveryError),
Transport {
url: String,
source: Error,
},
Status {
url: String,
status: StatusCode,
},
StreamClosed {
url: String,
},
Malformed(String),
Rpc {
code: i32,
message: String,
data: Option<Value>,
},
NoSession,
}Expand description
See module docs.
Variants§
Discovery(DiscoveryError)
No live daemon could be found (see DiscoveryError for the
specific reason — no candidate source, or a candidate that didn’t
answer the liveness ping).
Transport
A reqwest-level failure: DNS/connect/TLS, a request timeout, or a
response-body decode failure. Carries the URL for context.
Status
The daemon answered with a non-2xx HTTP status that carries no
JSON-RPC error envelope to parse (the SSE routes return a bare HTTP
status on failure, unlike POST /rpc, which always returns 200
with the error carried in the envelope — see
crate::serve::http::rpc_handler’s docs).
StreamClosed
The daemon closed an SSE stream cleanly (no transport error, no
non-2xx status) before this client observed a terminal event
(SessionDone/SessionCancelled) — and every reconnect attempt
(bounded by SESSION_STREAM_MAX_RECONNECTS) hit the same premature
close. Distinct from Self::Status/Self::Transport: nothing
about the individual HTTP request failed, only the STREAM never
reached a terminal state.
Malformed(String)
The daemon’s POST /rpc response body didn’t have the shape this
client expected (e.g. session.create’s result missing an id
field) — a daemon/client version-skew symptom, not a transport
failure.
Rpc
The daemon’s JSON-RPC error envelope for a POST /rpc call
(verbatim: code + message + optional data).
NoSession
handle_input/cancel_session was called before setup minted a
session (or after a session was never successfully created) — a
caller-sequencing error, never a transport failure.
Trait Implementations§
Source§impl Debug for EngineError
impl Debug for EngineError
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DiscoveryError> for EngineError
impl From<DiscoveryError> for EngineError
Source§fn from(source: DiscoveryError) -> Self
fn from(source: DiscoveryError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for EngineError
impl !UnwindSafe for EngineError
impl Freeze for EngineError
impl Send for EngineError
impl Sync for EngineError
impl Unpin for EngineError
impl UnsafeUnpin for EngineError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more