Skip to content

Commit

Permalink
feat: friendlier err msg for pclientd start
Browse files Browse the repository at this point in the history
Context: When testnets roll over, I clear out my state for pclientd and
bounce the service. On 55, I unthinkingly removed the entire "home"
directory for pclientd, which also removed the `config.toml` file
containing the FVK. When running `pclientd start`, a rather unhelpful
message about "No such file or directory" was displayed. Let's be a bit
clearer about what we expect to exist.
  • Loading branch information
conorsch committed Jun 26, 2023
1 parent 6552feb commit 006603c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/bin/pclientd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ impl Opt {
}
Command::Start { bind_addr } => {
tracing::info!(?opt.home, ?bind_addr, ?opt.node, "starting pclientd");

let config = PclientdConfig::load(opt.config_path())?;
let config = PclientdConfig::load(opt.config_path()).context(
"Failed to load pclientd config file. Have you run `pclientd init` with a FVK?",
)?;
let storage = opt.load_or_init_sqlite(&config.fvk).await?;

let proxy_channel = tonic::transport::Channel::from_shared(opt.node.to_string())
Expand Down

0 comments on commit 006603c

Please sign in to comment.