veloren/client/src/error.rs

40 lines
1000 B
Rust
Raw Normal View History

use authc::AuthClientError;
use network::{ParticipantError, StreamError};
pub use network::NetworkError;
#[derive(Debug)]
pub enum Error {
NetworkErr(NetworkError),
ParticipantErr(ParticipantError),
StreamErr(StreamError),
ServerWentMad,
ServerTimeout,
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,
AuthErr(String),
AuthClientError(AuthClientError),
AuthServerNotTrusted,
/// Persisted character data is invalid or missing
InvalidCharacter,
//TODO: InvalidAlias,
Other(String),
}
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) }
}
impl From<AuthClientError> for Error {
fn from(err: AuthClientError) -> Self { Self::AuthClientError(err) }
}