From: Matt Corallo Date: Sun, 17 Oct 2021 21:24:53 +0000 (+0000) Subject: Make APIError debug output more clear by including the variant X-Git-Tag: v0.0.104~15^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=6bcb270ae10472a1dd28a3211e80257b1a2b1fd1;p=rust-lightning Make APIError debug output more clear by including the variant --- 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)