-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathtracker_client.rs
More file actions
27 lines (26 loc) · 861 Bytes
/
Copy pathtracker_client.rs
File metadata and controls
27 lines (26 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//! Unified tracker client binary.
use torrust_tracker_console_client::console::clients::unified::app;
#[tokio::main]
async fn main() {
if let Err(error) = app::run().await {
match error {
app::Error::Check(err) => {
let (json, exit_code) = err.to_stderr_json_and_exit_code();
eprintln!("{json}");
std::process::exit(exit_code);
}
app::Error::Other(err) => {
let json = serde_json::json!({
"error": {
"kind": "runtime_failure",
"source": "runtime",
"message": err.to_string(),
}
})
.to_string();
eprintln!("{json}");
std::process::exit(1);
}
}
}
}