pub enum RetryableError {
Http(HttpError),
NonSuccessStatus {
status: StatusCode,
body: Option<String>,
},
Template(String),
}Expand description
Error type for operations that may be retried.
Wraps both network-level failures and HTTP status errors that indicate transient conditions (server overload, rate limiting, etc.).
Note: Despite the name, not all variants are inherently retryable.
Use [IsRetryable::is_retryable()] to determine if a specific error
should be retried.
Variants§
Http(HttpError)
Network-level error during the HTTP request.
NonSuccessStatus
Server returned a non-success (non-2xx) status code.
Important: This variant is not always retryable. Whether to retry depends on the specific status code:
- 5xx (server errors): typically retryable
- 429 (Too Many Requests): retryable
- 408 (Request Timeout): retryable
- Other 4xx (client errors): not retryable (configuration/request issue)
Use [IsRetryable::is_retryable()] to check.
Fields
§
status: StatusCodeHTTP status code
Template(String)
Template rendering failed.
The body template could not be rendered with the provided data.
Trait Implementations§
Source§impl Debug for RetryableError
impl Debug for RetryableError
Source§impl Display for RetryableError
impl Display for RetryableError
Source§impl Error for RetryableError
impl Error for RetryableError
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 From<HttpError> for RetryableError
impl From<HttpError> for RetryableError
Source§impl From<RetryableError> for WebhookError
impl From<RetryableError> for WebhookError
Source§fn from(source: RetryableError) -> Self
fn from(source: RetryableError) -> Self
Converts to this type from the input type.
Source§impl IsRetryable for RetryableError
impl IsRetryable for RetryableError
Source§fn is_retryable(&self) -> bool
fn is_retryable(&self) -> bool
Returns true if the error is potentially transient and should be retried.
Auto Trait Implementations§
impl Freeze for RetryableError
impl !RefUnwindSafe for RetryableError
impl Send for RetryableError
impl Sync for RetryableError
impl Unpin for RetryableError
impl !UnwindSafe for RetryableError
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
Mutably borrows from an owned value. Read more
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> 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.