From f92a6ea3dc84d0655a236262701bfdd5ff4f75ca Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 22 Jul 2018 12:25:56 +0200 Subject: [PATCH] Improve error logging --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index 91258c5..61c65d5 100644 --- a/app.py +++ b/app.py @@ -449,6 +449,16 @@ def handle_activitypub_error(error): return response +@app.errorhandler(Exception) +def handle_other_error(error): + logger.error( + f"caught error {error!r}, {traceback.format_tb(error.__traceback__)}" + ) + response = flask_jsonify({}) + response.status_code = 500 + return response + + # App routes ROBOTS_TXT = """User-agent: *