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, TooManyPlayers, NotOnWhitelist, AlreadyLoggedIn, AuthErr(String), AuthClientError(AuthClientError), AuthServerNotTrusted, /// Persisted character data is invalid or missing InvalidCharacter, //TODO: InvalidAlias, Other(String), } impl From for Error { fn from(err: NetworkError) -> Self { Self::NetworkErr(err) } } impl From for Error { fn from(err: ParticipantError) -> Self { Self::ParticipantErr(err) } } impl From for Error { fn from(err: StreamError) -> Self { Self::StreamErr(err) } } impl From for Error { fn from(err: AuthClientError) -> Self { Self::AuthClientError(err) } }