Files
cdk/crates/cdk-cln/src/error.rs
thesimplekid 9ac387ae3d Ln use common (#751)
* chore: cdk-cln use common

* feat: lnd use common

* feat: lnbits use common
2025-05-14 17:29:58 +01:00

36 lines
817 B
Rust

//! CLN Errors
use thiserror::Error;
/// CLN Error
#[derive(Debug, Error)]
pub enum Error {
/// Invoice amount not defined
#[error("Unknown invoice amount")]
UnknownInvoiceAmount,
/// Wrong CLN response
#[error("Wrong CLN response")]
WrongClnResponse,
/// Unknown invoice
#[error("Unknown invoice")]
UnknownInvoice,
/// Invalid payment hash
#[error("Invalid hash")]
InvalidHash,
/// Cln Error
#[error(transparent)]
Cln(#[from] cln_rpc::Error),
/// Cln Rpc Error
#[error(transparent)]
ClnRpc(#[from] cln_rpc::RpcError),
/// Amount Error
#[error(transparent)]
Amount(#[from] cdk_common::amount::Error),
}
impl From<Error> for cdk_common::payment::Error {
fn from(e: Error) -> Self {
Self::Lightning(Box::new(e))
}
}