mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 18:11:30 +01:00
lndrest: capture the pay error properly.
This commit is contained in:
parent
946279674a
commit
59aaea47fd
@ -102,12 +102,8 @@ class LndRestWallet(Wallet):
|
||||
timeout=180,
|
||||
)
|
||||
|
||||
if r.is_error:
|
||||
error_message = r.text
|
||||
try:
|
||||
error_message = r.json()["error"]
|
||||
except:
|
||||
pass
|
||||
if r.is_error or r.json().get("payment_error"):
|
||||
error_message = r.json().get("payment_error") or r.text
|
||||
return PaymentResponse(False, None, 0, None, error_message)
|
||||
|
||||
data = r.json()
|
||||
|
Loading…
Reference in New Issue
Block a user