diff --git a/app.py b/app.py index 525b23e..2598f0f 100755 --- a/app.py +++ b/app.py @@ -15,6 +15,7 @@ from sqlalchemy.orm import aliased from sqlalchemy.sql.expression import desc from collections import defaultdict from datetime import datetime +import inspect import itertools import hashlib import json @@ -79,7 +80,10 @@ def shutdown_session(exception=None): @app.errorhandler(InternalServerError) def exception_handler(e): tb = get_current_traceback() - return render_template('show_error.html', tb=tb), 500 + last_frame_args = inspect.getargs(tb.frames[-1].code) + return render_template('show_error.html', + tb=tb, + last_frame_args=last_frame_args), 500 @app.template_global() def set_url_args(endpoint=None, **new_args): diff --git a/templates/show_error.html b/templates/show_error.html index bfadc50..0c7a9af 100644 --- a/templates/show_error.html +++ b/templates/show_error.html @@ -9,7 +9,11 @@

Software error: {{ tb.exception_type }}

-

{{ tb.exception }}

+
{{ tb.exception }}
+ +

Error in function "{{ tb.frames[-1].function_name }}": + {{ last_frame_args | pprint }}

+
{% set body %}