pub enum WireKind {
Show 14 variants
Unauthorized,
ProtocolError,
NotFound,
Conflict,
StdinClosed,
TooLarge,
RequestTimeout,
NotBootstrapped,
ServerError,
InsufficientStorage,
Transport,
AuthTokenMint,
ExecTimeout,
OutputGap,
}Expand description
The fine-grained taxonomy: one variant per condition the daemon or the transport distinguishes.
These are the errors.py exception classes, which is what the conformance
suite asserts on. Several collapse onto one ErrorKind and that is the
point — the collapse happens at the exit code, not at the raise site.
Variants§
401: the presented bearer token is not the installed one. Fatal.
ProtocolError
400: malformed body, missing query key, bad mode, refused tar member.
Never 404. A 404 here reads as a missing file, which is exactly how one defect hid for a review round.
NotFound
404: a genuinely absent exec id, file, or directory.
Conflict
409: well-formed, but the target is in the wrong state.
StdinClosed
410: stdin already saw EOF, or the child stopped reading.
Distinct from WireKind::Conflict, which is “you did not ask for stdin”
and is fixed at start time. This one is a lifecycle fact.
TooLarge
413: over a configured cap (body, tar members or bytes, stdin write).
RequestTimeout
408: the child did not drain its stdin pipe within the write timeout.
Retryable, and the daemon deliberately keeps its stdin handle open so a retry can succeed. Some bytes may already have landed; reconciling that is the caller’s problem, which is why it is a distinct variant.
NotBootstrapped
503: the run hook has not landed, so the control API is closed.
Not 404 and not a dropped connection. Retry: the platform is about to deliver the token.
ServerError
5xx other than 503 and 507: spawn failure, io failure, a panicking task.
InsufficientStorage
507: a write would take the target filesystem under the daemon’s disk reserve.
Not retryable, and that’s why the daemon answers 507 rather than 500
(crates/agentd/src/fs.rs): an identical retry against a full disk fails the
same way, and a retry loop keyed on a 5xx would repeat it. The body names the
free and reserved bytes. The remedy is freeing space, then retrying.
Transport
The request never produced a status: connection refused, reset, timeout.
Retryable because it says nothing about the daemon’s state. A VM that has just reached RUNNING commonly refuses a connection or two before the proxy path is wired up.
AuthTokenMint
CreateMicrovmAuthToken failed.
Retryable, and load-bearing rather than optimistic: proxy tokens expire at 60 minutes, so a long run will mint mid-flight, and a throttle at that moment must not kill a trial that is otherwise healthy.
ExecTimeout
A client-side wait or stream deadline elapsed. The exec is untouched.
OutputGap
Output bytes are gone for good — the replay ring evicted them, or this subscriber lagged the live channel.
Implementations§
Source§impl WireKind
impl WireKind
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The stable name the CLI puts in data.kind and the bindings use for the
corresponding exception. Conformance tests compare these names.
Sourcepub fn status(self) -> Option<u16>
pub fn status(self) -> Option<u16>
The status that produces this variant, for the ones that come from one.
None for the four that have no status: two never got a response
(WireKind::Transport, WireKind::AuthTokenMint) and two are client-side
facts (WireKind::ExecTimeout, WireKind::OutputGap).
Sourcepub fn from_status(status: u16) -> Option<WireKind>
pub fn from_status(status: u16) -> Option<WireKind>
The variant a response status means, or None for a status the daemon does
not use to mean anything.
The table is explicit and there is deliberately no generic 4xx fallback.
The daemon’s whole point is that 400 and 404 mean different things, and a
fallback that mapped “some 4xx” to one variant would reintroduce the
phantom-missing-file defect that hid in the Python client for a review
round. 5xx does fall back — to WireKind::ServerError, which is what
errors.py does — because every 5xx means the same thing to a caller:
the daemon broke, try again. The two the daemon chooses on purpose keep their
own variants: 503 is “come back in a moment”, and 507 is “free space first”.
Sourcepub fn error_kind(self) -> ErrorKind
pub fn error_kind(self) -> ErrorKind
The exit-code class this collapses onto.
The ordering cli.py’s classify documents as “the contract” is a match
here rather than a sequence of isinstance tests, which removes the way it
could be got wrong: WireKind::Unauthorized is an HTTP error whose remedy
is a credential rather than a wait, and in Python it had to be checked
before the generic retryable test to avoid being swallowed by it. A match on
a closed enum has no order to get wrong.
Trait Implementations§
impl Copy for WireKind
impl Eq for WireKind
impl StructuralPartialEq for WireKind
Auto Trait Implementations§
impl Freeze for WireKind
impl RefUnwindSafe for WireKind
impl Send for WireKind
impl Sync for WireKind
impl Unpin for WireKind
impl UnsafeUnpin for WireKind
impl UnwindSafe for WireKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more