2020-01-02 08:43:45 +00:00
|
|
|
use authc::AuthClientError;
|
2019-03-03 22:02:38 +00:00
|
|
|
use common::net::PostError;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
Network(PostError),
|
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,
|
2019-08-07 19:42:44 +00:00
|
|
|
InvalidAuth,
|
2019-12-21 17:02:39 +00:00
|
|
|
AlreadyLoggedIn,
|
2020-01-02 08:43:45 +00:00
|
|
|
AuthClientError(AuthClientError),
|
|
|
|
AuthServerNotTrusted,
|
2019-07-05 12:16:08 +00:00
|
|
|
//TODO: InvalidAlias,
|
2019-03-03 22:02:38 +00:00
|
|
|
Other(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<PostError> for Error {
|
2020-01-02 08:43:45 +00:00
|
|
|
fn from(err: PostError) -> Self { Self::Network(err) }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<AuthClientError> for Error {
|
|
|
|
fn from(err: AuthClientError) -> Self { Self::AuthClientError(err) }
|
2019-03-03 22:02:38 +00:00
|
|
|
}
|