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 672c429
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum TemporaryFailureCode {
NoRoute,
InvoiceExpired,
Unexpected,
Unknown { msg: String },
}

#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -229,8 +230,8 @@ 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: TemporaryFailureCode::Unknown { msg: e.to_string() },
},
})
}
Expand Down

0 comments on commit 672c429

Please sign in to comment.