mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-07 06:56:07 +01:00
30 lines
665 B
Rust
30 lines
665 B
Rust
//! Error for phoenixd ln backend
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Phoenixd Error
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
/// Invoice amount not defined
|
|
#[error("Unknown invoice amount")]
|
|
UnknownInvoiceAmount,
|
|
/// Unknown invoice
|
|
#[error("Unknown invoice")]
|
|
UnknownInvoice,
|
|
/// Unsupported unit
|
|
#[error("Unit Unsupported")]
|
|
UnsupportedUnit,
|
|
/// phd error
|
|
#[error(transparent)]
|
|
Phd(#[from] phoenixd_rs::Error),
|
|
/// Anyhow error
|
|
#[error(transparent)]
|
|
Anyhow(#[from] anyhow::Error),
|
|
}
|
|
|
|
impl From<Error> for cdk::cdk_lightning::Error {
|
|
fn from(e: Error) -> Self {
|
|
Self::Lightning(Box::new(e))
|
|
}
|
|
}
|