From 672c429e3e88f0c04b7f2d9200bc03f679ff0c0d Mon Sep 17 00:00:00 2001 From: Dominic Leutenegger Date: Fri, 13 Oct 2023 17:21:56 +0200 Subject: [PATCH] Add unkown error code --- crow/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crow/src/lib.rs b/crow/src/lib.rs index 1d3d830..a57b8cf 100644 --- a/crow/src/lib.rs +++ b/crow/src/lib.rs @@ -26,6 +26,7 @@ pub enum TemporaryFailureCode { NoRoute, InvoiceExpired, Unexpected, + Unknown { msg: String }, } #[derive(Clone, Debug, PartialEq, Eq)] @@ -229,8 +230,8 @@ pub fn to_topup_error(code: Option) -> Option { "payout_expired" => TopupError::PermanentFailure { code: PermanentFailureCode::PayoutExpired, }, - _ => TopupError::TemporaryFailure { - code: TemporaryFailureCode::Unexpected, + e => TopupError::TemporaryFailure { + code: TemporaryFailureCode::Unknown { msg: e.to_string() }, }, }) }