Skip to content

Commit

Permalink
wireman: Improve error prompt on setup error
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Reiter committed Nov 23, 2024
1 parent f3c8549 commit f5f0579
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions wireman/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wireman"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
authors = ["preiter <[email protected]>"]
description = "A TUI based gRPC client"
Expand All @@ -12,7 +12,7 @@ rust-version = "1.70.0"

[dependencies]
# core = { package = "wireman-core", path = "../wireman-core", version = "0.1.2" }
# config = { package = "wireman-config", path = "../wireman-config", version = "0.1.1" }
# config = { package = "wireman-config", path = "../wireman-config", version = "0.2.1" }
# logger = { package = "wireman-logger", path = "../wireman-logger", version = "0.1.0" }
# theme = { package = "wireman-theme", path = "../wireman-theme", version = "0.2.0" }
# event-handler = { package = "wireman-event-handler", path = "../wireman-event-handler", version = "0.1.0" }
Expand All @@ -24,8 +24,8 @@ theme = { package = "wireman-theme", version = "0.2" }
event-handler = { package = "wireman-event-handler", version = "0.1" }

tui-widget-list = { version = "0.13" }
edtui = "0.9"
# edtui = { package = "edtui", path = "../../edtui", version = "0.9" }
# edtui = "0.9"
edtui = { package = "edtui", path = "../../edtui", version = "0.9" }
# edtui = { version = "0.9", git = "https://github.com/preiter93/edtui", branch = "tabs" }
crossterm = { version = "0.28", features = ["events", "event-stream"] }
ratatui = { package = "ratatui", version = "0.29", features = ["unstable"] }
Expand Down
14 changes: 12 additions & 2 deletions wireman/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ async fn main() -> Result<()> {
return Ok(());
}

let cfg = init_from_env()?;
App::run(cfg).await?;
match init_from_env() {
Ok(cfg) => App::run(cfg).await?,
Err(err) => match err {
config::error::Error::SetupError(err) => {
println!("Setup error: {err}");
println!("Did you install wireman?");
println!(" wireman install");
}
_ => println!("An error occured:\n{err}"),
},
}
// App::run(cfg).await?;

Ok(())
}

0 comments on commit f5f0579

Please sign in to comment.