chore: use Debug to print errors (#2086)

This commit is contained in:
Luna Yao
2026-04-09 03:45:55 +02:00
committed by GitHub
parent c5fbd29c0e
commit a8feb9ac2b
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -1185,9 +1185,9 @@ fn win_service_event_loop(
status_handle.set_service_status(normal_status).unwrap(); status_handle.set_service_status(normal_status).unwrap();
std::process::exit(0); std::process::exit(0);
} }
Err(e) => { Err(error) => {
status_handle.set_service_status(error_status).unwrap(); status_handle.set_service_status(error_status).unwrap();
log::error!("{}", e); log::error!(?error);
} }
} }
}, },
@@ -1501,8 +1501,8 @@ pub async fn main() -> ExitCode {
// Verify configurations // Verify configurations
if cli.check_config { if cli.check_config {
if let Err(e) = validate_config(&cli).await { if let Err(error) = validate_config(&cli).await {
log::error!("Config validation failed: {:?}", e); log::error!(?error, "Config validation failed");
return ExitCode::FAILURE; return ExitCode::FAILURE;
} else { } else {
return ExitCode::SUCCESS; return ExitCode::SUCCESS;
@@ -1512,7 +1512,7 @@ pub async fn main() -> ExitCode {
let mut ret_code = 0; let mut ret_code = 0;
if let Err(error) = run_main(cli).await { if let Err(error) = run_main(cli).await {
log::error!(%error); log::error!(?error);
ret_code = 1; ret_code = 1;
} }
+1 -1
View File
@@ -67,7 +67,7 @@ impl NatDstConnector for NatDstTcpConnector {
let socket = match TcpSocket::new_v4() { let socket = match TcpSocket::new_v4() {
Ok(s) => s, Ok(s) => s,
Err(error) => { Err(error) => {
log::error!(%error, "create v4 socket failed"); log::error!(?error, "create v4 socket failed");
return Err(error.into()); return Err(error.into());
} }
}; };