diff --git a/src/error.rs b/src/error.rs index 2d79d2b..d25afe1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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), @@ -278,6 +281,7 @@ impl IntoResponse for APIError { | APIError::CannotEstimateFees | APIError::CannotOpenChannel(_) | APIError::ChangingState + | APIError::FailedBroadcast(_) | APIError::FailedBitcoindConnection(_) | APIError::Indexer(_) | APIError::InsufficientAssets diff --git a/src/routes.rs b/src/routes.rs index da5d856..3f2b790 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -1059,6 +1059,7 @@ impl From 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,