pub trait ErrorExt: StackError {
// Required method
fn as_any(&self) -> &dyn Any;
// Provided methods
fn status_code(&self) -> StatusCode { ... }
fn retry_hint(&self) -> RetryHint { ... }
fn is_retryable(&self) -> bool { ... }
fn output_msg(&self) -> String
where Self: Sized { ... }
fn root_cause(&self) -> Option<&dyn Error>
where Self: Sized { ... }
}Expand description
Extension to Error in std.
Required Methods§
Provided Methods§
Sourcefn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Map this error to StatusCode.
Sourcefn retry_hint(&self) -> RetryHint
fn retry_hint(&self) -> RetryHint
Returns the retry hint for this error instance.
Implementations should return RetryHint::Retryable only when retrying the
same operation may succeed without changing the request. The default is
RetryHint::NonRetryable to avoid accidental retry loops.
Sourcefn is_retryable(&self) -> bool
fn is_retryable(&self) -> bool
Returns whether this error instance is marked retryable.
This is derived from Self::retry_hint. Transport-level retries, such as a
gRPC Unavailable, may still be handled separately by client code.
fn output_msg(&self) -> Stringwhere
Self: Sized,
Sourcefn root_cause(&self) -> Option<&dyn Error>where
Self: Sized,
fn root_cause(&self) -> Option<&dyn Error>where
Self: Sized,
Find out root level error for nested error