From 130beaf38a8a8a27313ca5bc08eabf90a13403e0 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 6 Sep 2020 23:39:46 -0300 Subject: [PATCH] fix undeclared ok error. --- lnbits/core/services.py | 5 ++--- lnbits/core/views/api.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lnbits/core/services.py b/lnbits/core/services.py index c7e6252..17ea8f1 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -107,9 +107,8 @@ def pay_invoice( if ok: create_payment(checking_id=checking_id, fee=fee_msat, **payment_kwargs) delete_payment(temp_id) - - if not ok: - raise Exception(error_message or "Unexpected backend error.") + else: + raise Exception(error_message or "Unexpected backend error.") return invoice.payment_hash diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 9a587ee..345aa51 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -74,6 +74,7 @@ def api_payments_pay_invoice(): except PermissionError as e: return jsonify({"message": str(e)}), HTTPStatus.FORBIDDEN except Exception as e: + print(e) return jsonify({"message": str(e)}), HTTPStatus.INTERNAL_SERVER_ERROR return (