Skip to content

Commit

Permalink
handle the FailedBroadcast rgb-lib error
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Oct 16, 2024
1 parent 8a49336 commit 250dbd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ pub enum APIError {
#[error("Failed to connect to bitcoind client: {0}")]
FailedBitcoindConnection(String),

#[error("Failed broadcast: {0}")]
FailedBroadcast(String),

#[error("Failed closing channel: {0}")]
FailedClosingChannel(String),

Expand Down Expand Up @@ -278,6 +281,7 @@ impl IntoResponse for APIError {
| APIError::CannotEstimateFees
| APIError::CannotOpenChannel(_)
| APIError::ChangingState
| APIError::FailedBroadcast(_)
| APIError::FailedBitcoindConnection(_)
| APIError::Indexer(_)
| APIError::InsufficientAssets
Expand Down
1 change: 1 addition & 0 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ impl From<RgbLibError> for APIError {
RgbLibError::AllocationsAlreadyAvailable => APIError::AllocationsAlreadyAvailable,
RgbLibError::AssetNotFound { .. } => APIError::UnknownContractId,
RgbLibError::CannotEstimateFees => APIError::CannotEstimateFees,
RgbLibError::FailedBroadcast { details } => APIError::FailedBroadcast(details),
RgbLibError::FailedIssuance { details } => APIError::FailedIssuingAsset(details),
RgbLibError::Indexer { details } => APIError::Indexer(details),
RgbLibError::InsufficientAllocationSlots => APIError::NoAvailableUtxos,
Expand Down

0 comments on commit 250dbd9

Please sign in to comment.