From 6bcb270ae10472a1dd28a3211e80257b1a2b1fd1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 17 Oct 2021 21:24:53 +0000 Subject: [PATCH] Make APIError debug output more clear by including the variant --- lightning/src/util/errors.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/util/errors.rs b/lightning/src/util/errors.rs index 6495d9de4..0c6099f7d 100644 --- a/lightning/src/util/errors.rs +++ b/lightning/src/util/errors.rs @@ -66,10 +66,10 @@ pub enum APIError { impl fmt::Debug for APIError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - APIError::APIMisuseError {ref err} => f.write_str(err), + APIError::APIMisuseError {ref err} => write!(f, "Misuse error: {}", err), APIError::FeeRateTooHigh {ref err, ref feerate} => write!(f, "{} feerate: {}", err, feerate), - APIError::RouteError {ref err} => f.write_str(err), - APIError::ChannelUnavailable {ref err} => f.write_str(err), + APIError::RouteError {ref err} => write!(f, "Route error: {}", err), + APIError::ChannelUnavailable {ref err} => write!(f, "Channel unavailable: {}", err), APIError::MonitorUpdateFailed => f.write_str("Client indicated a channel monitor update failed"), APIError::IncompatibleShutdownScript { ref script } => { write!(f, "Provided a scriptpubkey format not accepted by peer: {}", script) -- 2.39.5