mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 18:10:46 +02:00
Fixed error reporting for lntxbot source
This commit is contained in:
@ -63,7 +63,7 @@ class LNbitsWallet(Wallet):
|
|||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
r = await client.post(
|
r = await client.post(
|
||||||
url=f"{self.endpoint}/api/v1/payments", headers=self.key, json=data
|
url=f"{self.endpoint}/api/v1/payments", headers=self.key, json=data,
|
||||||
)
|
)
|
||||||
ok, checking_id, payment_request, error_message = (
|
ok, checking_id, payment_request, error_message = (
|
||||||
not r.is_error,
|
not r.is_error,
|
||||||
@ -85,7 +85,8 @@ class LNbitsWallet(Wallet):
|
|||||||
r = await client.post(
|
r = await client.post(
|
||||||
url=f"{self.endpoint}/api/v1/payments",
|
url=f"{self.endpoint}/api/v1/payments",
|
||||||
headers=self.key,
|
headers=self.key,
|
||||||
json={"out": True, "bolt11": bolt11},
|
json={"out": True, "bolt11": bolt11},
|
||||||
|
timeout=100,
|
||||||
)
|
)
|
||||||
ok, checking_id, fee_msat, error_message = not r.is_error, None, 0, None
|
ok, checking_id, fee_msat, error_message = not r.is_error, None, 0, None
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ class LntxbotWallet(Wallet):
|
|||||||
f"{self.endpoint}/payinvoice",
|
f"{self.endpoint}/payinvoice",
|
||||||
headers=self.auth,
|
headers=self.auth,
|
||||||
json={"invoice": bolt11},
|
json={"invoice": bolt11},
|
||||||
timeout=40,
|
timeout=100,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.is_error:
|
if "error" in r.json():
|
||||||
try:
|
try:
|
||||||
data = r.json()
|
data = r.json()
|
||||||
error_message = data["message"]
|
error_message = data["message"]
|
||||||
|
Reference in New Issue
Block a user