Skip to content

Commit

Permalink
nwc: improve errors
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Nov 16, 2024
1 parent 5f83a74 commit 1048846
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/nwc/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ pub enum Error {
#[error(transparent)]
NIP47(#[from] nip47::Error),
/// Relay
#[error(transparent)]
#[error("relay: {0}")]
Relay(#[from] nostr_relay_pool::relay::Error),
/// Premature exit from listener
#[error("premature exit from listener")]
PrematureExit,
/// Request timeout
#[error("timeout")]
Timeout,
Expand Down
2 changes: 1 addition & 1 deletion crates/nwc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl NWC {
}
}

Err(Error::Timeout)
Err(Error::PrematureExit)
})
.await
.ok_or(Error::Timeout)?
Expand Down

0 comments on commit 1048846

Please sign in to comment.