mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-26 15:42:52 +01:00
16 lines
389 B
Rust
16 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)
|
||
|
}
|
||
|
}
|
||
|
}
|