lndrest: capture the pay error properly.
This commit is contained in:
parent
946279674a
commit
59aaea47fd
1 changed files with 2 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue