pub struct S3Error { /* private fields */ }Expand description
A structured S3 client error.
Formatting an error never prints its underlying source or cleanup error. Source errors are retained only as redacted type markers, preventing URLs, headers, or response data from escaping through an otherwise innocent log statement.
Implementations§
Source§impl S3Error
impl S3Error
Sourcepub fn new(
category: ErrorCategory,
message: impl Into<String>,
retry: RetryClassification,
) -> Self
pub fn new( category: ErrorCategory, message: impl Into<String>, retry: RetryClassification, ) -> Self
Creates an error with a category, safe message, and retry classification.
Sourcepub fn configuration(message: impl Into<String>) -> Self
pub fn configuration(message: impl Into<String>) -> Self
Creates a configuration error.
Sourcepub fn unsupported(message: impl Into<String>) -> Self
pub fn unsupported(message: impl Into<String>) -> Self
Creates an unsupported-operation error.
Sourcepub fn transport<E>(source: E) -> Self
pub fn transport<E>(source: E) -> Self
Creates a transport error while retaining only a redacted source marker.
Sourcepub fn timeout(phase: TimeoutPhase, message: impl Into<String>) -> Self
pub fn timeout(phase: TimeoutPhase, message: impl Into<String>) -> Self
Creates a timeout error.
Sourcepub fn invalid_response(message: impl Into<String>) -> Self
pub fn invalid_response(message: impl Into<String>) -> Self
Creates an invalid-response error.
Sourcepub fn cancellation(message: impl Into<String>) -> Self
pub fn cancellation(message: impl Into<String>) -> Self
Creates a cancellation error.
Sourcepub fn with_source<E>(self, _source: E) -> Self
pub fn with_source<E>(self, _source: E) -> Self
Retains the source error’s type while discarding potentially sensitive text.
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Returns the broad error category.
Sourcepub fn status(&self) -> Option<u16>
pub fn status(&self) -> Option<u16>
Returns the numeric HTTP response status, when a response was received.
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the S3 request identifier, when supplied by the service.
Sourcepub fn host_id(&self) -> Option<&str>
pub fn host_id(&self) -> Option<&str>
Returns the S3 host identifier, when supplied by the service.
Sourcepub fn retry_classification(&self) -> RetryClassification
pub fn retry_classification(&self) -> RetryClassification
Returns the retry classification.
Sourcepub fn timeout_phase(&self) -> Option<TimeoutPhase>
pub fn timeout_phase(&self) -> Option<TimeoutPhase>
Returns the timeout phase, when this is a timeout error.
Sourcepub fn server_time(&self) -> Option<OffsetDateTime>
pub fn server_time(&self) -> Option<OffsetDateTime>
Returns the server’s reported time for a clock-skew failure.
Sourcepub fn clock_skew(&self) -> Option<Duration>
pub fn clock_skew(&self) -> Option<Duration>
Returns server_time - local_time for a clock-skew failure.
Sourcepub fn cleanup_failure(&self) -> Option<&Self>
pub fn cleanup_failure(&self) -> Option<&Self>
Returns the cleanup error attached to a primary failure.
Sourcepub fn attempts(&self) -> u32
pub fn attempts(&self) -> u32
Returns the number of completed request attempts represented by this error.
Sourcepub fn retry_stop_reason(&self) -> Option<RetryStopReason>
pub fn retry_stop_reason(&self) -> Option<RetryStopReason>
Returns why the client did not make another retry attempt.
Trait Implementations§
Source§impl Error for S3Error
impl Error for S3Error
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()
Auto Trait Implementations§
impl Freeze for S3Error
impl RefUnwindSafe for S3Error
impl Send for S3Error
impl Sync for S3Error
impl Unpin for S3Error
impl UnsafeUnpin for S3Error
impl UnwindSafe for S3Error
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> 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> 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