Add error messages when failed to start server

This commit is contained in:
KernelErr
2021-12-30 22:05:25 +08:00
parent bff92738d5
commit 8fbc0c370a
6 changed files with 18 additions and 9 deletions

View File

@@ -83,10 +83,16 @@ impl Server {
let handle = tokio::spawn(async move {
match config.protocol.as_ref() {
"tcp" => {
let _ = tcp::proxy(config).await;
let res = tcp::proxy(config.clone()).await;
if res.is_err() {
error!("Failed to start {}: {}", config.name, res.err().unwrap());
}
}
"kcp" => {
let _ = kcp::proxy(config).await;
let res = kcp::proxy(config.clone()).await;
if res.is_err() {
error!("Failed to start {}: {}", config.name, res.err().unwrap());
}
}
_ => {
error!("Invalid protocol: {}", config.protocol)