X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Ferrors.rs;h=17e55a9799bb503c987782a2937c52a00634abdf;hb=626c60600ef3a4ec93d5f13df8d766bf3a7cd664;hp=ad699354233cb705fd41221cee58293a3a62c3d2;hpb=f961daef33ad1e999c83aafbf654db449e0e93e0;p=rust-lightning diff --git a/lightning/src/util/errors.rs b/lightning/src/util/errors.rs index ad699354..17e55a97 100644 --- a/lightning/src/util/errors.rs +++ b/lightning/src/util/errors.rs @@ -9,14 +9,14 @@ //! Error types live here. -use ln::script::ShutdownScript; +use crate::ln::script::ShutdownScript; use alloc::string::String; use core::fmt; /// Indicates an error on the client's part (usually some variant of attempting to use too-low or /// too-high values) -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq)] pub enum APIError { /// Indicates the API was wholly misused (see err for more). Cases where these can be returned /// are documented, but generally indicates some precondition of a function was violated. @@ -35,7 +35,7 @@ pub enum APIError { }, /// A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route, /// too-many-hops, etc). - RouteError { + InvalidRoute { /// A human-readable error message err: &'static str }, @@ -74,7 +74,7 @@ impl fmt::Debug for APIError { match *self { APIError::APIMisuseError {ref err} => write!(f, "Misuse error: {}", err), APIError::FeeRateTooHigh {ref err, ref feerate} => write!(f, "{} feerate: {}", err, feerate), - APIError::RouteError {ref err} => write!(f, "Route error: {}", err), + APIError::InvalidRoute {ref err} => write!(f, "Invalid route provided: {}", err), APIError::ChannelUnavailable {ref err} => write!(f, "Channel unavailable: {}", err), APIError::MonitorUpdateInProgress => f.write_str("Client indicated a channel monitor update is in progress but not yet complete"), APIError::IncompatibleShutdownScript { ref script } => {