aws_sdk_s3/types/
error.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Error type for the `SelectObjectContentEventStreamError` operation.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum SelectObjectContentEventStreamError {
6    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
7    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
8    variable wildcard pattern and check `.code()`:
9     \
10       `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
11     \
12    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SelectObjectContentEventStreamError) for what information is available for the error.")]
13    Unhandled(crate::error::sealed_unhandled::Unhandled),
14}
15impl SelectObjectContentEventStreamError {
16    /// Creates the `SelectObjectContentEventStreamError::Unhandled` variant from any error type.
17    pub fn unhandled(
18        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
19    ) -> Self {
20        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
21            source: err.into(),
22            meta: ::std::default::Default::default(),
23        })
24    }
25
26    /// Creates the `SelectObjectContentEventStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
27    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
28        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
29            source: err.clone().into(),
30            meta: err,
31        })
32    }
33    ///
34    /// Returns error metadata, which includes the error code, message,
35    /// request ID, and potentially additional information.
36    ///
37    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
38        match self {
39            Self::Unhandled(e) => &e.meta,
40        }
41    }
42}
43impl ::std::error::Error for SelectObjectContentEventStreamError {
44    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
45        match self {
46            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
47        }
48    }
49}
50impl ::std::fmt::Display for SelectObjectContentEventStreamError {
51    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
52        match self {
53            Self::Unhandled(_inner) => {
54                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
55                    write!(f, "unhandled error ({code})")
56                } else {
57                    f.write_str("unhandled error")
58                }
59            }
60        }
61    }
62}
63impl ::aws_smithy_types::retry::ProvideErrorKind for SelectObjectContentEventStreamError {
64    fn code(&self) -> ::std::option::Option<&str> {
65        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
66    }
67    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
68        ::std::option::Option::None
69    }
70}
71impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SelectObjectContentEventStreamError {
72    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
73        match self {
74            Self::Unhandled(_inner) => &_inner.meta,
75        }
76    }
77}
78impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SelectObjectContentEventStreamError {
79    fn create_unhandled_error(
80        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
81        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
82    ) -> Self {
83        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
84            source,
85            meta: meta.unwrap_or_default(),
86        })
87    }
88}
89impl crate::s3_request_id::RequestIdExt for crate::types::error::SelectObjectContentEventStreamError {
90    fn extended_request_id(&self) -> Option<&str> {
91        self.meta().extended_request_id()
92    }
93}
94impl ::aws_types::request_id::RequestId for crate::types::error::SelectObjectContentEventStreamError {
95    fn request_id(&self) -> Option<&str> {
96        self.meta().request_id()
97    }
98}
99
100pub use crate::types::error::_object_already_in_active_tier_error::ObjectAlreadyInActiveTierError;
101
102pub use crate::types::error::_no_such_key::NoSuchKey;
103
104pub use crate::types::error::_too_many_parts::TooManyParts;
105
106pub use crate::types::error::_invalid_write_offset::InvalidWriteOffset;
107
108pub use crate::types::error::_invalid_request::InvalidRequest;
109
110pub use crate::types::error::_encryption_type_mismatch::EncryptionTypeMismatch;
111
112pub use crate::types::error::_no_such_bucket::NoSuchBucket;
113
114pub use crate::types::error::_not_found::NotFound;
115
116pub use crate::types::error::_invalid_object_state::InvalidObjectState;
117
118pub use crate::types::error::_bucket_already_owned_by_you::BucketAlreadyOwnedByYou;
119
120pub use crate::types::error::_bucket_already_exists::BucketAlreadyExists;
121
122pub use crate::types::error::_object_not_in_active_tier_error::ObjectNotInActiveTierError;
123
124pub use crate::types::error::_no_such_upload::NoSuchUpload;
125
126mod _bucket_already_exists;
127
128mod _bucket_already_owned_by_you;
129
130mod _encryption_type_mismatch;
131
132mod _invalid_object_state;
133
134mod _invalid_request;
135
136mod _invalid_write_offset;
137
138mod _no_such_bucket;
139
140mod _no_such_key;
141
142mod _no_such_upload;
143
144mod _not_found;
145
146mod _object_already_in_active_tier_error;
147
148mod _object_not_in_active_tier_error;
149
150mod _too_many_parts;
151
152/// Builders
153pub mod builders;