#[non_exhaustive]pub enum ClientError {
Transport(TransportError),
Codec(CratestackError),
State(String),
InvalidResponse(String),
BadInput(String),
Envelope(EnvelopeError),
Remote {
status: StatusCode,
error: Option<Box<CratestackErrorResponse>>,
message: String,
challenges: Challenges,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
Codec(CratestackError)
State(String)
InvalidResponse(String)
BadInput(String)
Envelope(EnvelopeError)
The signed transport failed (cratestack#1007). Never a decoded body.
Remote
Fields
status: StatusCodeerror: Option<Box<CratestackErrorResponse>>The decoded error envelope, boxed since cratestack#1208 gave it
an extra map: inline, it made every Result<_, ClientError>
carry it (clippy::result_large_err).
challenges: ChallengesEvery WWW-Authenticate value the answer carried, raw and in
order (cratestack#1243): an AuthRefusal’s challenges. Empty
when there were none. ClientError::challenges reads it.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn remote_error(&self) -> Option<&CratestackErrorResponse>
pub fn remote_error(&self) -> Option<&CratestackErrorResponse>
The decoded error envelope of a ClientError::Remote: code,
message, details and the extra members in extra. None for
any other variant, or when the body did not decode.
Sourcepub fn challenges(&self) -> &[String]
pub fn challenges(&self) -> &[String]
The WWW-Authenticate values of a ClientError::Remote, raw and
in order; empty for any other variant.
Source§impl ClientError
impl ClientError
Sourcepub fn step_up(&self) -> Option<StepUpRequired>
pub fn step_up(&self) -> Option<StepUpRequired>
The step-up refusal this error carries: a 401 whose envelope’s
extra member error is insufficient_user_authentication. None
for anything else.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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<ClientError> for RpcClientError
impl From<ClientError> for RpcClientError
Source§fn from(error: ClientError) -> Self
fn from(error: ClientError) -> Self
Source§impl From<ClientError> for RuntimeErrorWire
impl From<ClientError> for RuntimeErrorWire
Source§fn from(value: ClientError) -> Self
fn from(value: ClientError) -> Self
Source§impl From<CratestackError> for ClientError
impl From<CratestackError> for ClientError
Source§impl From<EnvelopeError> for ClientError
impl From<EnvelopeError> for ClientError
Source§fn from(source: EnvelopeError) -> Self
fn from(source: EnvelopeError) -> Self
Source§impl From<Error> for ClientError
impl From<Error> for ClientError
Source§impl StepUpError for ClientError
impl StepUpError for ClientError
Source§fn step_up(&self) -> Option<StepUpRequired>
fn step_up(&self) -> Option<StepUpRequired>
Auto Trait Implementations§
impl !RefUnwindSafe for ClientError
impl !UnwindSafe for ClientError
impl Freeze for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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