Skip to content

Commit

Permalink
Display error message on connection failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej Klajnert committed Apr 29, 2021
1 parent 3e07621 commit fcdf8c8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 156 deletions.
213 changes: 60 additions & 153 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Control the IDASEN desk position via bluetooth."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
idasen = "0.1.4"
idasen = { path = "../idasen" }
toml = "0.5.8"
serde = { version = "1.0.123", features = ["derive"] }
shellexpand = "2.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ fn get_desk(config: &Config) -> Idasen<impl Device> {
println!("Connected successfully.");
return desk;
}
Err(_) => {
Err(error) => {
if attempt >= max_attempts {
eprintln!("Failed to connect to the desk.");
eprintln!("Failed to connect to the desk: {}.", error);
process::exit(1);
} else {
attempt += 1;
Expand Down

0 comments on commit fcdf8c8

Please sign in to comment.