pub enum HostError {
Show 14 variants
VersionMismatch {
host: String,
provider: String,
provider_version: String,
},
Wire(String),
Transport {
id: String,
message: String,
},
InsecureTransport {
id: String,
host: String,
},
Unauthorized {
id: String,
},
ProviderCrashed {
id: String,
},
Timeout {
id: String,
timeout_ms: u64,
},
Provider {
id: String,
code: Option<ErrorCode>,
message: String,
},
ConsentRequired {
id: String,
data_flow: DataFlow,
},
ConsentScopeRequired {
id: String,
scopes: Vec<EgressScope>,
},
UnexpectedEnvelope {
id: String,
expected: String,
got: String,
},
CorrelationMismatch {
id: String,
expected: String,
got: String,
},
UnknownProvider(String),
Spawn(String),
}Expand description
Anything the host runtime can surface while talking to a provider.
Variants§
VersionMismatch
The provider speaks an incompatible protocol family
(SPEC.md). Reported the instant the handshake ack
arrives — never a hang (task deliverable 1).
Wire(String)
A line/body could not be encoded to or decoded from the wire envelope
(SPEC.md §2). A malformed provider message is a
clean error, never a host crash (task deliverable 5).
Transport
The underlying transport (stdio pipe or HTTP) failed.
InsecureTransport
The host refused to open a plaintext (http://) transport to a
non-loopback provider (SPEC.md §4.2, C7): the query payload — and
any bearer credential — would cross the network in cleartext. Raised
before any bytes are sent, so nothing left the host. The message
names only the id and host — never a credential (C8).
The provider rejected the host’s bearer credential (HTTP 401). Distinct
from a bare Transport failure so a host can react to
an auth rejection specifically. The message names only the id and the
status — never the credential itself (SPEC.md §4.2, C8).
Fields
ProviderCrashed
The provider’s child process closed its stream mid-exchange — it
crashed. Isolated to this provider; never poisons a query_all
(task deliverable 5).
Timeout
The provider took longer than the host’s per-provider budget.
Provider
The provider reported an error over the wire (an error envelope).
code carries the structured ErrorCode the provider sent (#9) so it
survives the transport boundary instead of collapsing to a bare message;
a host can then key its reaction (ErrorCode::reaction) off the code
rather than sniffing the free-form string. None when the provider
declared no code — read it as ErrorCode::Internal per SPEC.md.
ConsentRequired
The provider declares egress and has no recorded consent, so the
host refuses to transmit a query to it (SPEC.md
SPEC.md §4 — a host MUST NOT auto-enable egress providers). The query
payload never left the host.
ConsentScopeRequired
The provider declares one or more off-machine egress scopes with no
recorded consent receipt, so the host refuses to transmit a query to it
(docs/context-reuse.md §3 — requirement C6). scopes names exactly
the scopes that would leave unconsented. The query payload never left
the host.
UnexpectedEnvelope
A message of the wrong kind arrived where the protocol expected a
specific envelope (e.g. a frames reply to a query).
CorrelationMismatch
A provider that declared correlation answered without echoing the
request’s id, or echoed the wrong one (SPEC.md §H4).
Fatal to the exchange rather than a warning: once replies cannot be matched to requests, a pipelining host could hand one caller’s frames to another, and silently mixing evidence between tasks is worse than failing the query.
UnknownProvider(String)
No provider is registered under the given id.
Spawn(String)
Spawning the provider child process failed.
Trait Implementations§
Source§impl Error for HostError
impl Error for HostError
1.30.0 · 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()