X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Ferrors.rs;h=9446b35854baf9e34f665d3e1755ab7f599c4992;hb=ed30a199e35070c85fdf8199ec4ea65bcbec9a47;hp=f9c7f7111951fa8200c558c59dcdbdcbf13f480b;hpb=3aeec96470cc681bf6bf50baa5ce1b533762c479;p=rust-lightning diff --git a/src/util/errors.rs b/src/util/errors.rs index f9c7f711..9446b358 100644 --- a/src/util/errors.rs +++ b/src/util/errors.rs @@ -20,12 +20,19 @@ pub enum APIError { /// The feerate which was too high. feerate: u64 }, - - /// Invalid route or parameters (cltv_delta, fee, pubkey) was specified + /// A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route, + /// too-many-hops, etc). RouteError { /// A human-readable error message err: &'static str }, + /// We were unable to complete the request as the Channel required to do so is unable to + /// complete the request (or was not found). This can take many forms, including disconnected + /// peer, channel at capacity, channel shutting down, etc. + ChannelUnavailable { + /// A human-readable error message + err: &'static str + } } impl fmt::Debug for APIError { @@ -34,6 +41,7 @@ impl fmt::Debug for APIError { APIError::APIMisuseError {ref err} => f.write_str(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), } } }