pub struct ProviderError {
pub kind: ProviderErrorKind,
pub status_code: Option<StatusCode>,
pub body: Option<Value>,
pub latency: Duration,
}
Fields§
§kind: ProviderErrorKind
What type of error this is
status_code: Option<StatusCode>
The HTTP status code, if there was one.
body: Option<Value>
The returned body, if there was one
latency: Duration
How much time it took before we received the error
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn from_kind(kind: ProviderErrorKind) -> Self
pub fn from_kind(kind: ProviderErrorKind) -> Self
A simple constructor for a ProviderError that only needs a kind
Sourcepub fn transforming_request() -> Self
pub fn transforming_request() -> Self
A helper for creating a ProviderError
with the TransformingRequest error kind. This is by
far the most common case in the codebase.
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl HttpError for ProviderError
impl HttpError for ProviderError
Source§type Detail = Value
type Detail = Value
The type of the error detail. Can be [()] if there is no detail for this error.
Source§fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
The status code that the error should return.
Source§fn error_kind(&self) -> &'static str
fn error_kind(&self) -> &'static str
An error code that may provide additional information to clients on how to behave in
response to the error.
Source§fn error_detail(&self) -> Self::Detail
fn error_detail(&self) -> Self::Detail
Extra detail about this error
Source§fn response_tuple(&self) -> (StatusCode, ErrorResponseData<Self::Detail>)
fn response_tuple(&self) -> (StatusCode, ErrorResponseData<Self::Detail>)
The status code and data for this error. Most implementors of this trait will not
need to override the default implementation.
Source§fn obfuscate(&self) -> Option<ForceObfuscate>
fn obfuscate(&self) -> Option<ForceObfuscate>
Return a value to force the [ObfuscateErrorLayer] to obfuscate this error’s response in production, even if
it would not otherwise do so.
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnwindSafe for ProviderError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
Source§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
The type of the wrapped error after instrumentation
Source§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Instrument an Error by bundling it with a SpanTrace Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.