#[non_exhaustive]pub enum RequestError {
Rpc(RpcError),
Timeout {
after: Duration,
},
Closed,
Wire(WireError),
Undecodable(WireError),
UnexpectedReply {
asked: &'static str,
answered: &'static str,
},
}Expand description
Why a Client::request (or Client::request_with_deadline) call failed.
Non-exhaustive: expect more variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rpc(RpcError)
The daemon accepted the request and answered it with a structured error.
Timeout
No reply arrived within the request’s own deadline plus DEADLINE_GRACE.
Closed
The connection closed (daemon exit, crash, or a prior Client::close)
before this request’s reply arrived.
Wire(WireError)
body failed to encode onto the wire.
Undecodable(WireError)
The daemon’s reply arrived but this build could not decode it.
Distinct from Self::Rpc: the daemon did not report a structured
error, it answered with something (a Reply or an unrecognized
ServerFrame variant) that does not match the shapes this build
knows. The likely cause is a daemon newer than this client, not a
daemon-side failure, so the message says which side could not read.
UnexpectedReply
The daemon answered with a Response other than the one a typed
request expects, such as a Flock for a DogConfig.
Names both by variant alone: a listing or a dog’s section never reaches the message.
Fields
answered: &'static strThe answer received, by Response::name.
Implementations§
Source§impl RequestError
impl RequestError
Sourcepub const fn exit_code(&self) -> u8
pub const fn exit_code(&self) -> u8
The shep_core::exit code a process stopping on this error uses.
A refusal takes its own code’s number, and a closed connection is nothing answering. A reply this build cannot decode is a plain failure, since neither side is known to be at fault.
Trait Implementations§
Source§impl Clone for RequestError
impl Clone for RequestError
Source§impl Debug for RequestError
impl Debug for RequestError
Source§impl Display for RequestError
impl Display for RequestError
impl Eq for RequestError
Source§impl Error for RequestError
impl Error for RequestError
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<RequestError> for ShepherdError
impl From<RequestError> for ShepherdError
Source§fn from(err: RequestError) -> Self
fn from(err: RequestError) -> Self
Source§impl From<RequestError> for SheepSettingsReadError
impl From<RequestError> for SheepSettingsReadError
Source§fn from(err: RequestError) -> Self
fn from(err: RequestError) -> Self
Source§impl PartialEq for RequestError
impl PartialEq for RequestError
impl StructuralPartialEq for RequestError
Auto Trait Implementations§
impl Forget for RequestError
impl Freeze for RequestError
impl RefUnwindSafe for RequestError
impl Send for RequestError
impl Sync for RequestError
impl Unpin for RequestError
impl UnsafeUnpin for RequestError
impl UnwindSafe for RequestError
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.