We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1833d4 commit 33be10aCopy full SHA for 33be10a
app/app.py
@@ -51,6 +51,13 @@
51
r = redis.from_url(os.getenv("REDIS_URL"), decode_responses=True)
52
53
54
+# Global error handler for unhandled exceptions
55
+@app.errorhandler(Exception)
56
+def handle_exception(e):
57
+ logger.error(f"Unhandled exception in {request.endpoint}: {str(e)}", exc_info=True)
58
+ return jsonify({"error": "An error occurred while processing your request."}), 500
59
+
60
61
def validate_pow(nonce, data, difficulty):
62
# Calculate the sha256 of the concatenated string of 32-bit X-Nonce header and raw body.
63
# This calculation has to match the code on the client side, in index.html.
0 commit comments