diff --git a/src/api/src/error.rs b/src/api/src/error.rs index d58fe96..a8a5149 100644 --- a/src/api/src/error.rs +++ b/src/api/src/error.rs @@ -26,27 +26,3 @@ pub enum PaymentError { }, InvalidPatron, } - -impl std::fmt::Display for PaymentError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - PaymentError::UnsupportedPaymentType => write!(f, "Unsupported payment type"), - PaymentError::LedgerUnreachable { ledger } => { - write!(f, "Ledger unreachable: {ledger}") - } - PaymentError::LedgerWithdrawFromError { ledger, error } => { - write!(f, "Ledger {ledger} withdraw_from error: {error:?}") - } - PaymentError::LedgerTransferFromError { ledger, error } => { - write!(f, "Ledger {ledger} transfer_from error: {error:?}") - } - PaymentError::InsufficientFunds { needed, available } => { - write!( - f, - "Insufficient funds: needed {needed}, available {available}" - ) - } - PaymentError::InvalidPatron => write!(f, "Invalid patron"), - } - } -} diff --git a/src/wrapper/src/api/call.rs b/src/wrapper/src/api/call.rs index f5433d8..69fc481 100644 --- a/src/wrapper/src/api/call.rs +++ b/src/wrapper/src/api/call.rs @@ -5,8 +5,8 @@ use crate::domain::types::BridgeCallArgs; use crate::payments::guard_config::PAYMENT_GUARD; use crate::util::cycles::forward_raw; -fn map_guard_err(e: E) -> String { - BridgeError::GuardError(e.to_string()).to_string() +fn map_guard_err(e: E) -> String { + BridgeError::GuardError(format!("{e:?}")).to_string() } /// Internal helper to unify the bridge logic: charge fee -> forward call.