diff --git a/app/errors/handlers.py b/app/errors/handlers.py index 40ae2aa..06c8687 100644 --- a/app/errors/handlers.py +++ b/app/errors/handlers.py @@ -1,6 +1,7 @@ from app import db from app.errors import bp from flask import render_template +import traceback @bp.app_errorhandler(404) @@ -27,7 +28,13 @@ def internal_error(error): str: HTML page for error 500. """ db.session.rollback() - return render_template("500.html"), 500 + # Capture the exception details + traceback_info = traceback.format_exc() + + return ( + render_template("500.html", traceback_info=traceback_info), + 500, + ) @bp.app_errorhandler(413) diff --git a/app/errors/templates/500.html b/app/errors/templates/500.html index 003dff9..bdd57d4 100644 --- a/app/errors/templates/500.html +++ b/app/errors/templates/500.html @@ -1,10 +1,12 @@ {% extends "base.html" %} {% block content %}

Error 500: An unexpected error has occurred

-

Please try going to the Standard Vocabulary module and - press "Save tree" to re-generate files and use this function again !

+

If this happened in the visualisation module, a common fix could be going to the Standard Vocabulary module and + press "Save tree" to re-generate files !

The administrator has been notified. Sorry for the inconvenience!

Please press the back button to go to the index: Back

-{% endblock %} +

Traceback:

+
{{ traceback_info }}
+ {% endblock %} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4bb5494..a1fa4ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "impatient" -version = "1.6.0" +version = "1.6.1" description = "IMPatienT: an integrated web application to digitize, process and explore multimodal patient data" authors = ["Corentin Meyer "] license = "AGPL"