1 //! Error types live here.
5 /// Indicates an error on the client's part (usually some variant of attempting to use too-low or
8 /// Indicates the API was wholly misused (see err for more). Cases where these can be returned
9 /// are documented, but generally indicates some precondition of a function was violated.
11 /// A human-readable error message
14 /// Due to a high feerate, we were unable to complete the request.
15 /// For example, this may be returned if the feerate implies we cannot open a channel at the
16 /// requested value, but opening a larger channel would succeed.
18 /// A human-readable error message
20 /// The feerate which was too high.
23 /// A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
24 /// too-many-hops, etc).
26 /// A human-readable error message
29 /// We were unable to complete the request as the Channel required to do so is unable to
30 /// complete the request (or was not found). This can take many forms, including disconnected
31 /// peer, channel at capacity, channel shutting down, etc.
33 /// A human-readable error message
36 /// An attempt to call add_update_monitor returned an Err (ie you did this!), causing the
37 /// attempted action to fail.
41 impl fmt::Debug for APIError {
42 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
44 APIError::APIMisuseError {ref err} => f.write_str(err),
45 APIError::FeeRateTooHigh {ref err, ref feerate} => write!(f, "{} feerate: {}", err, feerate),
46 APIError::RouteError {ref err} => f.write_str(err),
47 APIError::ChannelUnavailable {ref err} => f.write_str(err),
48 APIError::MonitorUpdateFailed => f.write_str("Client indicated a channel monitor update failed"),