#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
BadRequestError(crate::error::BadRequestError),
ForbiddenError(crate::error::ForbiddenError),
InternalError(crate::error::InternalError),
NotFoundError(crate::error::NotFoundError),
RateLimitError(crate::error::RateLimitError),
UnauthorizedError(crate::error::UnauthorizedError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::BadRequestError(inner) => inner.fmt(f),
Error::ForbiddenError(inner) => inner.fmt(f),
Error::InternalError(inner) => inner.fmt(f),
Error::NotFoundError(inner) => inner.fmt(f),
Error::RateLimitError(inner) => inner.fmt(f),
Error::UnauthorizedError(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::FindLobbyError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::FindLobbyError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::FindLobbyErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::FindLobbyErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::FindLobbyErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::FindLobbyErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::FindLobbyErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::FindLobbyErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::FindLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::JoinLobbyError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::JoinLobbyError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::JoinLobbyErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::JoinLobbyErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::JoinLobbyErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::JoinLobbyErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::JoinLobbyErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::JoinLobbyErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::JoinLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListLobbiesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListLobbiesError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListLobbiesErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::ListLobbiesErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::ListLobbiesErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::ListLobbiesErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::ListLobbiesErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::ListLobbiesErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::ListLobbiesErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListRegionsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListRegionsError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListRegionsErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::ListRegionsErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::ListRegionsErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::ListRegionsErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::ListRegionsErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::ListRegionsErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::ListRegionsErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::LobbyReadyError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::LobbyReadyError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::LobbyReadyErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::LobbyReadyErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::LobbyReadyErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::LobbyReadyErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::LobbyReadyErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::LobbyReadyErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::LobbyReadyErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PlayerConnectedError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PlayerConnectedError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::PlayerConnectedErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::PlayerConnectedErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::PlayerConnectedErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::PlayerConnectedErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::PlayerConnectedErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::PlayerConnectedErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::PlayerConnectedErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PlayerDisconnectedError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::PlayerDisconnectedError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::PlayerDisconnectedErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::PlayerDisconnectedErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::PlayerDisconnectedErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::PlayerDisconnectedErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::PlayerDisconnectedErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::PlayerDisconnectedErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::PlayerDisconnectedErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetLobbyClosedError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::SetLobbyClosedError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::SetLobbyClosedErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::SetLobbyClosedErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::SetLobbyClosedErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::SetLobbyClosedErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::SetLobbyClosedErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::SetLobbyClosedErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::SetLobbyClosedErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl std::error::Error for Error {}