error.rs 590 B

1234567891011121314151617181920212223242526
  1. //! Error for Strike ln backend
  2. use thiserror::Error;
  3. /// Strike 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. /// Strikers error
  13. #[error(transparent)]
  14. StrikeRs(#[from] strike_rs::Error),
  15. /// Anyhow error
  16. #[error(transparent)]
  17. Anyhow(#[from] anyhow::Error),
  18. }
  19. impl From<Error> for cdk::cdk_lightning::Error {
  20. fn from(e: Error) -> Self {
  21. Self::Lightning(Box::new(e))
  22. }
  23. }