Add LightningPaymentFailedError exception (#706)

* add error code

* fix test
This commit is contained in:
callebtc
2025-03-06 00:04:37 +01:00
committed by GitHub
parent f72a3f260f
commit 9305905a85
3 changed files with 19 additions and 10 deletions

View File

@@ -36,6 +36,7 @@ from ..core.errors import (
KeysetError,
KeysetNotFoundError,
LightningError,
LightningPaymentFailedError,
NotAllowedError,
QuoteNotPaidError,
QuoteSignatureInvalidError,
@@ -1057,7 +1058,7 @@ class Ledger(LedgerVerification, LedgerSpendingConditions, LedgerTasks, LedgerFe
logger.error(
f"Status check error: {status.error_message}"
)
raise LightningError(
raise LightningPaymentFailedError(
f"Lightning payment failed{': ' + payment.error_message if payment.error_message else ''}."
)
case _: