rivet-matchmaker 0.0.8

Rivet service for matchmaking players and managing lobbies
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// All possible error types for this service.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
	/// An error thrown when the requestee has sent an invalid or malformed request.
	BadRequestError(crate::error::BadRequestError),
	/// An error thrown when the requestee requests a resource they do not have access to.
	ForbiddenError(crate::error::ForbiddenError),
	/// An error caused by internal server problems.
	InternalError(crate::error::InternalError),
	/// An error thrown when the requestee requests a non existant resource.
	NotFoundError(crate::error::NotFoundError),
	/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly.
	RateLimitError(crate::error::RateLimitError),
	/// An error thrown when the requestee is not authenticated.
	UnauthorizedError(crate::error::UnauthorizedError),
	/// An unhandled error occurred.
	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 {}