Skip to content

Commit

Permalink
Handle other fedimint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jul 1, 2024
1 parent 51d5426 commit 6c81321
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mutiny-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,13 @@ impl From<anyhow::Error> for MutinyError {
match e.to_string().as_str() {
"Insufficient balance" => Self::InsufficientBalance,
"MissingInvoiceAmount" => Self::BadAmountError,
"Federation didn't return peg-out fees" => Self::FederationConnectionFailed,
"The generated transaction would be rejected by the federation for being too large." => Self::FederationTxTooLarge,
_ => Self::Other(e),
str => if str.starts_with("Address isn't compatible with the federation's network") {
Self::IncorrectNetwork
} else {
Self::Other(e)
},
}
}
}

0 comments on commit 6c81321

Please sign in to comment.