Skip to content

Commit

Permalink
Add unkown error code
Browse files Browse the repository at this point in the history
  • Loading branch information
dleutenegger committed Oct 13, 2023
1 parent c8d85a6 commit ef8f180
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pub enum TemporaryFailureCode {
NoRoute,
InvoiceExpired,
Unexpected,
Unknown {
msg: String
},
}

#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -229,8 +232,10 @@ pub fn to_topup_error(code: Option<String>) -> Option<TopupError> {
"payout_expired" => TopupError::PermanentFailure {
code: PermanentFailureCode::PayoutExpired,
},
_ => TopupError::TemporaryFailure {
code: TemporaryFailureCode::Unexpected,
e => TopupError::TemporaryFailure {
code: TemporaryFailure::Unknown {
msg: e.to_string()
},
},
})
}
Expand Down

0 comments on commit ef8f180

Please sign in to comment.