rivet_client_api_chat/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(std::fmt::Debug)]
5pub enum Error {
6	/// An error thrown when the requestee has sent an invalid or malformed request.
7	BadRequestError(crate::error::BadRequestError),
8	/// An error thrown when the requestee requests a resource they do not have access to.
9	ForbiddenError(crate::error::ForbiddenError),
10	/// An error caused by internal server problems.
11	InternalError(crate::error::InternalError),
12	/// An error thrown when the requestee requests a non existant resource.
13	NotFoundError(crate::error::NotFoundError),
14	/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly.
15	RateLimitError(crate::error::RateLimitError),
16	/// An error thrown when the requestee is not authenticated.
17	UnauthorizedError(crate::error::UnauthorizedError),
18	/// An unhandled error occurred.
19	Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
20}
21impl std::fmt::Display for Error {
22	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23		match self {
24			Error::BadRequestError(inner) => inner.fmt(f),
25			Error::ForbiddenError(inner) => inner.fmt(f),
26			Error::InternalError(inner) => inner.fmt(f),
27			Error::NotFoundError(inner) => inner.fmt(f),
28			Error::RateLimitError(inner) => inner.fmt(f),
29			Error::UnauthorizedError(inner) => inner.fmt(f),
30			Error::Unhandled(inner) => inner.fmt(f),
31		}
32	}
33}
34impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetDirectThreadError, R>> for Error
35where
36	R: Send + Sync + std::fmt::Debug + 'static,
37{
38	fn from(err: aws_smithy_http::result::SdkError<crate::error::GetDirectThreadError, R>) -> Self {
39		match err {
40			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
41				crate::error::GetDirectThreadErrorKind::InternalError(inner) => {
42					Error::InternalError(inner)
43				}
44				crate::error::GetDirectThreadErrorKind::RateLimitError(inner) => {
45					Error::RateLimitError(inner)
46				}
47				crate::error::GetDirectThreadErrorKind::ForbiddenError(inner) => {
48					Error::ForbiddenError(inner)
49				}
50				crate::error::GetDirectThreadErrorKind::UnauthorizedError(inner) => {
51					Error::UnauthorizedError(inner)
52				}
53				crate::error::GetDirectThreadErrorKind::NotFoundError(inner) => {
54					Error::NotFoundError(inner)
55				}
56				crate::error::GetDirectThreadErrorKind::BadRequestError(inner) => {
57					Error::BadRequestError(inner)
58				}
59				crate::error::GetDirectThreadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
60			},
61			_ => Error::Unhandled(err.into()),
62		}
63	}
64}
65impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetThreadHistoryError, R>> for Error
66where
67	R: Send + Sync + std::fmt::Debug + 'static,
68{
69	fn from(
70		err: aws_smithy_http::result::SdkError<crate::error::GetThreadHistoryError, R>,
71	) -> Self {
72		match err {
73			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
74				crate::error::GetThreadHistoryErrorKind::InternalError(inner) => {
75					Error::InternalError(inner)
76				}
77				crate::error::GetThreadHistoryErrorKind::RateLimitError(inner) => {
78					Error::RateLimitError(inner)
79				}
80				crate::error::GetThreadHistoryErrorKind::ForbiddenError(inner) => {
81					Error::ForbiddenError(inner)
82				}
83				crate::error::GetThreadHistoryErrorKind::UnauthorizedError(inner) => {
84					Error::UnauthorizedError(inner)
85				}
86				crate::error::GetThreadHistoryErrorKind::NotFoundError(inner) => {
87					Error::NotFoundError(inner)
88				}
89				crate::error::GetThreadHistoryErrorKind::BadRequestError(inner) => {
90					Error::BadRequestError(inner)
91				}
92				crate::error::GetThreadHistoryErrorKind::Unhandled(inner) => {
93					Error::Unhandled(inner)
94				}
95			},
96			_ => Error::Unhandled(err.into()),
97		}
98	}
99}
100impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetThreadTopicError, R>> for Error
101where
102	R: Send + Sync + std::fmt::Debug + 'static,
103{
104	fn from(err: aws_smithy_http::result::SdkError<crate::error::GetThreadTopicError, R>) -> Self {
105		match err {
106			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
107				crate::error::GetThreadTopicErrorKind::InternalError(inner) => {
108					Error::InternalError(inner)
109				}
110				crate::error::GetThreadTopicErrorKind::RateLimitError(inner) => {
111					Error::RateLimitError(inner)
112				}
113				crate::error::GetThreadTopicErrorKind::ForbiddenError(inner) => {
114					Error::ForbiddenError(inner)
115				}
116				crate::error::GetThreadTopicErrorKind::UnauthorizedError(inner) => {
117					Error::UnauthorizedError(inner)
118				}
119				crate::error::GetThreadTopicErrorKind::NotFoundError(inner) => {
120					Error::NotFoundError(inner)
121				}
122				crate::error::GetThreadTopicErrorKind::BadRequestError(inner) => {
123					Error::BadRequestError(inner)
124				}
125				crate::error::GetThreadTopicErrorKind::Unhandled(inner) => Error::Unhandled(inner),
126			},
127			_ => Error::Unhandled(err.into()),
128		}
129	}
130}
131impl<R> From<aws_smithy_http::result::SdkError<crate::error::SendChatMessageError, R>> for Error
132where
133	R: Send + Sync + std::fmt::Debug + 'static,
134{
135	fn from(err: aws_smithy_http::result::SdkError<crate::error::SendChatMessageError, R>) -> Self {
136		match err {
137			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
138				crate::error::SendChatMessageErrorKind::InternalError(inner) => {
139					Error::InternalError(inner)
140				}
141				crate::error::SendChatMessageErrorKind::RateLimitError(inner) => {
142					Error::RateLimitError(inner)
143				}
144				crate::error::SendChatMessageErrorKind::ForbiddenError(inner) => {
145					Error::ForbiddenError(inner)
146				}
147				crate::error::SendChatMessageErrorKind::UnauthorizedError(inner) => {
148					Error::UnauthorizedError(inner)
149				}
150				crate::error::SendChatMessageErrorKind::NotFoundError(inner) => {
151					Error::NotFoundError(inner)
152				}
153				crate::error::SendChatMessageErrorKind::BadRequestError(inner) => {
154					Error::BadRequestError(inner)
155				}
156				crate::error::SendChatMessageErrorKind::Unhandled(inner) => Error::Unhandled(inner),
157			},
158			_ => Error::Unhandled(err.into()),
159		}
160	}
161}
162impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetThreadReadError, R>> for Error
163where
164	R: Send + Sync + std::fmt::Debug + 'static,
165{
166	fn from(err: aws_smithy_http::result::SdkError<crate::error::SetThreadReadError, R>) -> Self {
167		match err {
168			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
169				crate::error::SetThreadReadErrorKind::InternalError(inner) => {
170					Error::InternalError(inner)
171				}
172				crate::error::SetThreadReadErrorKind::RateLimitError(inner) => {
173					Error::RateLimitError(inner)
174				}
175				crate::error::SetThreadReadErrorKind::ForbiddenError(inner) => {
176					Error::ForbiddenError(inner)
177				}
178				crate::error::SetThreadReadErrorKind::UnauthorizedError(inner) => {
179					Error::UnauthorizedError(inner)
180				}
181				crate::error::SetThreadReadErrorKind::NotFoundError(inner) => {
182					Error::NotFoundError(inner)
183				}
184				crate::error::SetThreadReadErrorKind::BadRequestError(inner) => {
185					Error::BadRequestError(inner)
186				}
187				crate::error::SetThreadReadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
188			},
189			_ => Error::Unhandled(err.into()),
190		}
191	}
192}
193impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetTypingStatusError, R>> for Error
194where
195	R: Send + Sync + std::fmt::Debug + 'static,
196{
197	fn from(err: aws_smithy_http::result::SdkError<crate::error::SetTypingStatusError, R>) -> Self {
198		match err {
199			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
200				crate::error::SetTypingStatusErrorKind::InternalError(inner) => {
201					Error::InternalError(inner)
202				}
203				crate::error::SetTypingStatusErrorKind::RateLimitError(inner) => {
204					Error::RateLimitError(inner)
205				}
206				crate::error::SetTypingStatusErrorKind::ForbiddenError(inner) => {
207					Error::ForbiddenError(inner)
208				}
209				crate::error::SetTypingStatusErrorKind::UnauthorizedError(inner) => {
210					Error::UnauthorizedError(inner)
211				}
212				crate::error::SetTypingStatusErrorKind::NotFoundError(inner) => {
213					Error::NotFoundError(inner)
214				}
215				crate::error::SetTypingStatusErrorKind::BadRequestError(inner) => {
216					Error::BadRequestError(inner)
217				}
218				crate::error::SetTypingStatusErrorKind::Unhandled(inner) => Error::Unhandled(inner),
219			},
220			_ => Error::Unhandled(err.into()),
221		}
222	}
223}
224impl<R> From<aws_smithy_http::result::SdkError<crate::error::WatchThreadError, R>> for Error
225where
226	R: Send + Sync + std::fmt::Debug + 'static,
227{
228	fn from(err: aws_smithy_http::result::SdkError<crate::error::WatchThreadError, R>) -> Self {
229		match err {
230			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
231				crate::error::WatchThreadErrorKind::InternalError(inner) => {
232					Error::InternalError(inner)
233				}
234				crate::error::WatchThreadErrorKind::RateLimitError(inner) => {
235					Error::RateLimitError(inner)
236				}
237				crate::error::WatchThreadErrorKind::ForbiddenError(inner) => {
238					Error::ForbiddenError(inner)
239				}
240				crate::error::WatchThreadErrorKind::UnauthorizedError(inner) => {
241					Error::UnauthorizedError(inner)
242				}
243				crate::error::WatchThreadErrorKind::NotFoundError(inner) => {
244					Error::NotFoundError(inner)
245				}
246				crate::error::WatchThreadErrorKind::BadRequestError(inner) => {
247					Error::BadRequestError(inner)
248				}
249				crate::error::WatchThreadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
250			},
251			_ => Error::Unhandled(err.into()),
252		}
253	}
254}
255impl std::error::Error for Error {}