mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-02 04:25:27 +01:00
33 lines
722 B
Rust
33 lines
722 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),
|
|
}
|
|
|
|
impl From<Error> for cdk::cdk_lightning::Error {
|
|
fn from(e: Error) -> Self {
|
|
Self::Lightning(Box::new(e))
|
|
}
|
|
}
|