mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cleanup error codes
This commit is contained in:
parent
b443e4dd31
commit
2ea5fd876b
@ -9,7 +9,6 @@ pub enum Error {
|
||||
NetworkErr(NetworkError),
|
||||
ParticipantErr(ParticipantError),
|
||||
StreamErr(StreamError),
|
||||
ServerWentMad,
|
||||
ServerTimeout,
|
||||
ServerShutdown,
|
||||
TooManyPlayers,
|
||||
|
@ -59,6 +59,7 @@ where
|
||||
.add_directive("tokio_util=info".parse().unwrap())
|
||||
.add_directive("rustls=info".parse().unwrap())
|
||||
.add_directive("veloren_network_protocol=info".parse().unwrap())
|
||||
.add_directive("quinn_proto::connection=info".parse().unwrap())
|
||||
.add_directive(
|
||||
"veloren_server::persistence::character=info"
|
||||
.parse()
|
||||
|
@ -17,7 +17,6 @@ use tracing::{trace, warn};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
NoAddress,
|
||||
ClientError {
|
||||
error: ClientError,
|
||||
mismatched_server_info: Option<ServerInfo>,
|
||||
@ -128,8 +127,11 @@ impl ClientInit {
|
||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||
}
|
||||
|
||||
// Parsing/host name resolution successful but no connection succeeded.
|
||||
let _ = tx.send(Msg::Done(Err(last_err.unwrap_or(Error::NoAddress))));
|
||||
// Only possibility for no last_err is aborting
|
||||
let _ = tx.send(Msg::Done(Err(last_err.unwrap_or(Error::ClientError {
|
||||
error: ClientError::Other("Connection attempt aborted by user".to_owned()),
|
||||
mismatched_server_info: None,
|
||||
}))));
|
||||
|
||||
// Safe drop runtime
|
||||
tokio::task::block_in_place(move || drop(runtime2));
|
||||
|
@ -279,7 +279,6 @@ fn get_client_msg_error(e: client_init::Error, localized_strings: &LocalizationH
|
||||
|
||||
use client::Error;
|
||||
match e {
|
||||
InitError::NoAddress => localization.get("main.login.server_not_found").into(),
|
||||
InitError::ClientError {
|
||||
error,
|
||||
mismatched_server_info,
|
||||
@ -297,9 +296,6 @@ fn get_client_msg_error(e: client_init::Error, localized_strings: &LocalizationH
|
||||
Error::AuthServerNotTrusted => {
|
||||
localization.get("main.login.untrusted_auth_server").into()
|
||||
},
|
||||
Error::ServerWentMad => localization
|
||||
.get("main.login.outdated_client_or_server")
|
||||
.into(),
|
||||
Error::ServerTimeout => localization.get("main.login.timeout").into(),
|
||||
Error::ServerShutdown => localization.get("main.login.server_shut_down").into(),
|
||||
Error::NotOnWhitelist => localization.get("main.login.not_on_whitelist").into(),
|
||||
|
Loading…
Reference in New Issue
Block a user