catch errors in multiple places that might be destroying the async flow and causing lnbits to die silently.

This commit is contained in:
fiatjaf
2021-04-10 17:37:48 -03:00
parent b48a44bcd0
commit fdf4f6c1ae
9 changed files with 82 additions and 55 deletions
+4 -5
View File
@@ -119,11 +119,10 @@ async def api_lnurl_callback(unique_hash):
await update_withdraw_link(link.id, **changes)
except ValueError as e:
return jsonify({"status": "ERROR", "reason": str(e)}), HTTPStatus.OK
return jsonify({"status": "ERROR", "reason": str(e)})
except PermissionError:
return (
jsonify({"status": "ERROR", "reason": "Withdraw link is empty."}),
HTTPStatus.OK,
)
return jsonify({"status": "ERROR", "reason": "Withdraw link is empty."})
except Exception as e:
return jsonify({"status": "ERROR", "reason": str(e)})
return jsonify({"status": "OK"}), HTTPStatus.OK