fix: catch all exceptions for webhook
This commit is contained in:
parent
9fed2f2ae0
commit
681883a8f9
1 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import asyncio
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
from lnbits.core import db as core_db
|
from lnbits.core import db as core_db
|
||||||
from lnbits.core.models import Payment
|
from lnbits.core.models import Payment
|
||||||
|
|
@ -50,7 +51,8 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||||
|
|
||||||
r = await client.post(pay_link.webhook_url, **kwargs)
|
r = await client.post(pay_link.webhook_url, **kwargs)
|
||||||
await mark_webhook_sent(payment, r.status_code)
|
await mark_webhook_sent(payment, r.status_code)
|
||||||
except (httpx.ConnectError, httpx.RequestError):
|
except Exception as ex:
|
||||||
|
logger.error(ex)
|
||||||
await mark_webhook_sent(payment, -1)
|
await mark_webhook_sent(payment, -1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue