catch errors in multiple places that might be destroying the async flow and causing lnbits to die silently.

This commit is contained in:
fiatjaf
2021-04-10 17:37:48 -03:00
parent b48a44bcd0
commit fdf4f6c1ae
9 changed files with 82 additions and 55 deletions
+7 -4
View File
@@ -86,10 +86,13 @@ class BleskomatLnurl(NamedTuple):
raise LnurlValidationError("Maximum number of uses already reached")
tag = self.tag
if tag == "withdrawRequest":
payment_hash = await pay_invoice(
wallet_id=self.wallet,
payment_request=query["pr"],
)
try:
payment_hash = await pay_invoice(
wallet_id=self.wallet,
payment_request=query["pr"],
)
except Exception as exc:
raise LnurlValidationError(f"Failed to pay invoice: {exc.message}")
if not payment_hash:
raise LnurlValidationError("Failed to pay invoice")