mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-26 15:42:52 +01:00
`APIMisuse` when paramters passed from the client is invalid `FeeRateTooHigh` when a channel cannot be opened due to high feerate
15 lines
389 B
Rust
15 lines
389 B
Rust
use std::fmt;
|
|
|
|
pub enum APIError {
|
|
APIMisuseError {err: &'static str},
|
|
FeeRateTooHigh {err: String, feerate: u64},
|
|
}
|
|
|
|
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::FeeRateTooHigh {ref err, ref feerate} => write!(f, "{} feerate: {}", err, feerate)
|
|
}
|
|
}
|
|
}
|