rivet_matchmaker/
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::FindLobbyError, R>> for Error
35where
36	R: Send + Sync + std::fmt::Debug + 'static,
37{
38	fn from(err: aws_smithy_http::result::SdkError<crate::error::FindLobbyError, R>) -> Self {
39		match err {
40			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
41				crate::error::FindLobbyErrorKind::InternalError(inner) => {
42					Error::InternalError(inner)
43				}
44				crate::error::FindLobbyErrorKind::RateLimitError(inner) => {
45					Error::RateLimitError(inner)
46				}
47				crate::error::FindLobbyErrorKind::ForbiddenError(inner) => {
48					Error::ForbiddenError(inner)
49				}
50				crate::error::FindLobbyErrorKind::UnauthorizedError(inner) => {
51					Error::UnauthorizedError(inner)
52				}
53				crate::error::FindLobbyErrorKind::NotFoundError(inner) => {
54					Error::NotFoundError(inner)
55				}
56				crate::error::FindLobbyErrorKind::BadRequestError(inner) => {
57					Error::BadRequestError(inner)
58				}
59				crate::error::FindLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
60			},
61			_ => Error::Unhandled(err.into()),
62		}
63	}
64}
65impl<R> From<aws_smithy_http::result::SdkError<crate::error::JoinLobbyError, R>> for Error
66where
67	R: Send + Sync + std::fmt::Debug + 'static,
68{
69	fn from(err: aws_smithy_http::result::SdkError<crate::error::JoinLobbyError, R>) -> Self {
70		match err {
71			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
72				crate::error::JoinLobbyErrorKind::InternalError(inner) => {
73					Error::InternalError(inner)
74				}
75				crate::error::JoinLobbyErrorKind::RateLimitError(inner) => {
76					Error::RateLimitError(inner)
77				}
78				crate::error::JoinLobbyErrorKind::ForbiddenError(inner) => {
79					Error::ForbiddenError(inner)
80				}
81				crate::error::JoinLobbyErrorKind::UnauthorizedError(inner) => {
82					Error::UnauthorizedError(inner)
83				}
84				crate::error::JoinLobbyErrorKind::NotFoundError(inner) => {
85					Error::NotFoundError(inner)
86				}
87				crate::error::JoinLobbyErrorKind::BadRequestError(inner) => {
88					Error::BadRequestError(inner)
89				}
90				crate::error::JoinLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
91			},
92			_ => Error::Unhandled(err.into()),
93		}
94	}
95}
96impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListLobbiesError, R>> for Error
97where
98	R: Send + Sync + std::fmt::Debug + 'static,
99{
100	fn from(err: aws_smithy_http::result::SdkError<crate::error::ListLobbiesError, R>) -> Self {
101		match err {
102			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
103				crate::error::ListLobbiesErrorKind::InternalError(inner) => {
104					Error::InternalError(inner)
105				}
106				crate::error::ListLobbiesErrorKind::RateLimitError(inner) => {
107					Error::RateLimitError(inner)
108				}
109				crate::error::ListLobbiesErrorKind::ForbiddenError(inner) => {
110					Error::ForbiddenError(inner)
111				}
112				crate::error::ListLobbiesErrorKind::UnauthorizedError(inner) => {
113					Error::UnauthorizedError(inner)
114				}
115				crate::error::ListLobbiesErrorKind::NotFoundError(inner) => {
116					Error::NotFoundError(inner)
117				}
118				crate::error::ListLobbiesErrorKind::BadRequestError(inner) => {
119					Error::BadRequestError(inner)
120				}
121				crate::error::ListLobbiesErrorKind::Unhandled(inner) => Error::Unhandled(inner),
122			},
123			_ => Error::Unhandled(err.into()),
124		}
125	}
126}
127impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListRegionsError, R>> for Error
128where
129	R: Send + Sync + std::fmt::Debug + 'static,
130{
131	fn from(err: aws_smithy_http::result::SdkError<crate::error::ListRegionsError, R>) -> Self {
132		match err {
133			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
134				crate::error::ListRegionsErrorKind::InternalError(inner) => {
135					Error::InternalError(inner)
136				}
137				crate::error::ListRegionsErrorKind::RateLimitError(inner) => {
138					Error::RateLimitError(inner)
139				}
140				crate::error::ListRegionsErrorKind::ForbiddenError(inner) => {
141					Error::ForbiddenError(inner)
142				}
143				crate::error::ListRegionsErrorKind::UnauthorizedError(inner) => {
144					Error::UnauthorizedError(inner)
145				}
146				crate::error::ListRegionsErrorKind::NotFoundError(inner) => {
147					Error::NotFoundError(inner)
148				}
149				crate::error::ListRegionsErrorKind::BadRequestError(inner) => {
150					Error::BadRequestError(inner)
151				}
152				crate::error::ListRegionsErrorKind::Unhandled(inner) => Error::Unhandled(inner),
153			},
154			_ => Error::Unhandled(err.into()),
155		}
156	}
157}
158impl<R> From<aws_smithy_http::result::SdkError<crate::error::LobbyReadyError, R>> for Error
159where
160	R: Send + Sync + std::fmt::Debug + 'static,
161{
162	fn from(err: aws_smithy_http::result::SdkError<crate::error::LobbyReadyError, R>) -> Self {
163		match err {
164			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
165				crate::error::LobbyReadyErrorKind::InternalError(inner) => {
166					Error::InternalError(inner)
167				}
168				crate::error::LobbyReadyErrorKind::RateLimitError(inner) => {
169					Error::RateLimitError(inner)
170				}
171				crate::error::LobbyReadyErrorKind::ForbiddenError(inner) => {
172					Error::ForbiddenError(inner)
173				}
174				crate::error::LobbyReadyErrorKind::UnauthorizedError(inner) => {
175					Error::UnauthorizedError(inner)
176				}
177				crate::error::LobbyReadyErrorKind::NotFoundError(inner) => {
178					Error::NotFoundError(inner)
179				}
180				crate::error::LobbyReadyErrorKind::BadRequestError(inner) => {
181					Error::BadRequestError(inner)
182				}
183				crate::error::LobbyReadyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
184			},
185			_ => Error::Unhandled(err.into()),
186		}
187	}
188}
189impl<R> From<aws_smithy_http::result::SdkError<crate::error::PlayerConnectedError, R>> for Error
190where
191	R: Send + Sync + std::fmt::Debug + 'static,
192{
193	fn from(err: aws_smithy_http::result::SdkError<crate::error::PlayerConnectedError, R>) -> Self {
194		match err {
195			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
196				crate::error::PlayerConnectedErrorKind::InternalError(inner) => {
197					Error::InternalError(inner)
198				}
199				crate::error::PlayerConnectedErrorKind::RateLimitError(inner) => {
200					Error::RateLimitError(inner)
201				}
202				crate::error::PlayerConnectedErrorKind::ForbiddenError(inner) => {
203					Error::ForbiddenError(inner)
204				}
205				crate::error::PlayerConnectedErrorKind::UnauthorizedError(inner) => {
206					Error::UnauthorizedError(inner)
207				}
208				crate::error::PlayerConnectedErrorKind::NotFoundError(inner) => {
209					Error::NotFoundError(inner)
210				}
211				crate::error::PlayerConnectedErrorKind::BadRequestError(inner) => {
212					Error::BadRequestError(inner)
213				}
214				crate::error::PlayerConnectedErrorKind::Unhandled(inner) => Error::Unhandled(inner),
215			},
216			_ => Error::Unhandled(err.into()),
217		}
218	}
219}
220impl<R> From<aws_smithy_http::result::SdkError<crate::error::PlayerDisconnectedError, R>> for Error
221where
222	R: Send + Sync + std::fmt::Debug + 'static,
223{
224	fn from(
225		err: aws_smithy_http::result::SdkError<crate::error::PlayerDisconnectedError, R>,
226	) -> Self {
227		match err {
228			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
229				crate::error::PlayerDisconnectedErrorKind::InternalError(inner) => {
230					Error::InternalError(inner)
231				}
232				crate::error::PlayerDisconnectedErrorKind::RateLimitError(inner) => {
233					Error::RateLimitError(inner)
234				}
235				crate::error::PlayerDisconnectedErrorKind::ForbiddenError(inner) => {
236					Error::ForbiddenError(inner)
237				}
238				crate::error::PlayerDisconnectedErrorKind::UnauthorizedError(inner) => {
239					Error::UnauthorizedError(inner)
240				}
241				crate::error::PlayerDisconnectedErrorKind::NotFoundError(inner) => {
242					Error::NotFoundError(inner)
243				}
244				crate::error::PlayerDisconnectedErrorKind::BadRequestError(inner) => {
245					Error::BadRequestError(inner)
246				}
247				crate::error::PlayerDisconnectedErrorKind::Unhandled(inner) => {
248					Error::Unhandled(inner)
249				}
250			},
251			_ => Error::Unhandled(err.into()),
252		}
253	}
254}
255impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetLobbyClosedError, R>> for Error
256where
257	R: Send + Sync + std::fmt::Debug + 'static,
258{
259	fn from(err: aws_smithy_http::result::SdkError<crate::error::SetLobbyClosedError, R>) -> Self {
260		match err {
261			aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
262				crate::error::SetLobbyClosedErrorKind::InternalError(inner) => {
263					Error::InternalError(inner)
264				}
265				crate::error::SetLobbyClosedErrorKind::RateLimitError(inner) => {
266					Error::RateLimitError(inner)
267				}
268				crate::error::SetLobbyClosedErrorKind::ForbiddenError(inner) => {
269					Error::ForbiddenError(inner)
270				}
271				crate::error::SetLobbyClosedErrorKind::UnauthorizedError(inner) => {
272					Error::UnauthorizedError(inner)
273				}
274				crate::error::SetLobbyClosedErrorKind::NotFoundError(inner) => {
275					Error::NotFoundError(inner)
276				}
277				crate::error::SetLobbyClosedErrorKind::BadRequestError(inner) => {
278					Error::BadRequestError(inner)
279				}
280				crate::error::SetLobbyClosedErrorKind::Unhandled(inner) => Error::Unhandled(inner),
281			},
282			_ => Error::Unhandled(err.into()),
283		}
284	}
285}
286impl std::error::Error for Error {}