2020-01-02 08:43:45 +00:00
|
|
|
use authc::AuthClientError;
|
2020-07-01 09:45:39 +00:00
|
|
|
pub use network::NetworkError;
|
2020-07-01 09:51:37 +00:00
|
|
|
use network::{ParticipantError, StreamError};
|
2019-03-03 22:02:38 +00:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
2020-07-01 07:30:38 +00:00
|
|
|
NetworkErr(NetworkError),
|
|
|
|
ParticipantErr(ParticipantError),
|
|
|
|
StreamErr(StreamError),
|
2019-04-10 17:23:27 +00:00
|
|
|
ServerWentMad,
|
2019-03-05 18:39:18 +00:00
|
|
|
ServerTimeout,
|
2019-03-03 22:02:38 +00:00
|
|
|
ServerShutdown,
|
2019-07-01 11:19:26 +00:00
|
|
|
TooManyPlayers,
|
2020-06-24 15:27:18 +00:00
|
|
|
NotOnWhitelist,
|
2019-12-21 17:02:39 +00:00
|
|
|
AlreadyLoggedIn,
|
2020-01-07 06:27:18 +00:00
|
|
|
AuthErr(String),
|
2020-01-02 08:43:45 +00:00
|
|
|
AuthClientError(AuthClientError),
|
|
|
|
AuthServerNotTrusted,
|
2020-05-11 10:06:53 +00:00
|
|
|
/// Persisted character data is invalid or missing
|
|
|
|
InvalidCharacter,
|
2019-07-05 12:16:08 +00:00
|
|
|
//TODO: InvalidAlias,
|
2019-03-03 22:02:38 +00:00
|
|
|
Other(String),
|
|
|
|
}
|
|
|
|
|
2020-07-01 07:30:38 +00:00
|
|
|
impl From<NetworkError> for Error {
|
|
|
|
fn from(err: NetworkError) -> Self { Self::NetworkErr(err) }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<ParticipantError> for Error {
|
|
|
|
fn from(err: ParticipantError) -> Self { Self::ParticipantErr(err) }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<StreamError> for Error {
|
|
|
|
fn from(err: StreamError) -> Self { Self::StreamErr(err) }
|
2020-01-02 08:43:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl From<AuthClientError> for Error {
|
|
|
|
fn from(err: AuthClientError) -> Self { Self::AuthClientError(err) }
|
2019-03-03 22:02:38 +00:00
|
|
|
}
|