pub enum PeerError {
Unknown {
peer: PeerId,
},
Delegation {
peer: PeerId,
source: Box<DelegationError>,
},
WrongAudience {
peer: PeerId,
held_for: PeerId,
},
NoSubject {
peer: PeerId,
},
NoPlaneCredential {
peer: PeerId,
},
NotGranted {
peer: PeerId,
capability: String,
},
Unreachable {
peer: PeerId,
detail: String,
},
Refused {
peer: PeerId,
detail: String,
},
TimedOut {
peer: PeerId,
detail: String,
},
InDoubt {
peer: PeerId,
detail: String,
},
InvalidResponse {
peer: PeerId,
detail: String,
},
Failed {
peer: PeerId,
detail: String,
},
}Expand description
Why a peer call could not be made, or did not work.
Variants§
Unknown
This peer is not in the registry.
Delegation
The hop would hand the peer authority the caller does not hold, or would take the request too far from the human who authorised it.
Fields
source: Box<DelegationError>Boxed: the refusal names both links’ bounds, and every peer
call’s Result would otherwise carry that width on its happy path.
WrongAudience
The credential on hand is for someone else.
NoSubject
The peer is told who each call is for, and this run acts for nobody.
Refused rather than sent with the credential held for the peer: that credential names nobody, and presenting it for a run with no chain is the ambient authority a subject-bound peer was wired to rule out.
NoPlaneCredential
A run admitted as the plane called a subject-bound peer, and the grant holds no credential of the plane’s own for it.
NotGranted
The capability asked for is outside what this peer is granted.
The peer would refuse it at admission — the chain it receives permits only the grant’s scope — but a call that cannot succeed should not leave: it costs a round trip, lands in the peer’s journal as a refused admission, and reads to the operator as the peer declining rather than as this plane never having granted it.
Unreachable
The call never left.
Refused
The peer received it and declined without acting.
TimedOut
Sent, and no answer came within the deadline.
Only for actual timeouts. Everything else that leaves the outcome
unknown — an answered fault, an unreadable response, a connection that
died mid-flight — is InDoubt, because “did not
answer in time” is a false diagnosis of a peer that answered HTTP 500
promptly, and a false diagnosis is what an operator debugs first.
InDoubt
The request may have reached the peer, and the outcome is unknown.
The in-doubt bucket stated honestly: an HTTP 5xx, a JSON-RPC internal error, a response that could not be read, a request that failed mid-flight. Each says the peer may have acted; none says it was slow.
InvalidResponse
Sent, but the peer’s response did not conform to the negotiated protocol.
The request may already have caused work, so this is in doubt rather than a clean refusal.
Failed
The peer acted and reported failure.
Implementations§
Source§impl PeerError
impl PeerError
Sourcepub const fn disposition(&self) -> Disposition
pub const fn disposition(&self) -> Disposition
What this failure says about whether the request reached the peer.
Trait Implementations§
Source§impl Error for PeerError
impl Error for PeerError
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()
Auto Trait Implementations§
impl Freeze for PeerError
impl RefUnwindSafe for PeerError
impl Send for PeerError
impl Sync for PeerError
impl Unpin for PeerError
impl UnsafeUnpin for PeerError
impl UnwindSafe for PeerError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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