Skip to content

Commit

Permalink
print exceptions using eprintln
Browse files Browse the repository at this point in the history
  • Loading branch information
optimm committed Jul 3, 2023
1 parent 1a89c5d commit bde522c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions teos/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ async fn main() {
Ok(appointments) => {
println!("{}", pretty_json(&appointments.into_inner()).unwrap())
}
Err(status) => println!("{}", status.message()),
Err(status) => {
eprintln!("{}", status.message());
std::process::exit(1);
}
}
}
Err(e) => println!("{e}"),
Err(e) => {
eprintln!("{e}");
std::process::exit(1);
}
};
}
Command::GetTowerInfo => {
Expand All @@ -106,10 +112,16 @@ async fn main() {
Ok(response) => {
println!("{}", pretty_json(&response.into_inner()).unwrap())
}
Err(status) => println!("{}", status.message()),
Err(status) => {
eprintln!("{}", status.message());
std::process::exit(1);
}
}
}
Err(e) => println!("{e}"),
Err(e) => {
eprintln!("{e}");
std::process::exit(1);
}
};
}
Command::Stop => {
Expand Down

0 comments on commit bde522c

Please sign in to comment.