error.rs 490 B

1234567891011121314151617181920212223
  1. //! Fake Wallet Error
  2. use thiserror::Error;
  3. /// Fake Wallet Error
  4. #[derive(Debug, Error)]
  5. pub enum Error {
  6. /// Invoice amount not defined
  7. #[error("Unknown invoice amount")]
  8. UnknownInvoiceAmount,
  9. /// Unknown invoice
  10. #[error("Unknown invoice")]
  11. UnknownInvoice,
  12. /// Unknown invoice
  13. #[error("No channel receiver")]
  14. NoReceiver,
  15. }
  16. impl From<Error> for cdk::cdk_lightning::Error {
  17. fn from(e: Error) -> Self {
  18. Self::Lightning(Box::new(e))
  19. }
  20. }