Added logger output on error 500

Cherry picked and tweaked from
fdec916528
This commit is contained in:
2025-06-06 16:34:08 +01:00
parent 6cba9a6d2b
commit ab8a357137
2 changed files with 6 additions and 1 deletions

View File

@@ -8,4 +8,4 @@
"""Metadata for this python module.""" """Metadata for this python module."""
__version__ = "2025.6.6.3" __version__ = "2025.6.6.4"

View File

@@ -8,6 +8,7 @@
"""invenio module for I-Form theme.""" """invenio module for I-Form theme."""
import traceback
from functools import wraps from functools import wraps
from typing import Dict from typing import Dict
@@ -121,6 +122,10 @@ def default_error_handler(e: Exception):
# - `e`, the passed-in exception # - `e`, the passed-in exception
# to get proxied-to objects: `flask.request._get_current_object()` # to get proxied-to objects: `flask.request._get_current_object()`
msg = f"default_error_handler of invenio-theme-iform captured following error type: {
type(e)
} with message {e} and stack trace {traceback.format_exc()}"
current_app.logger.error(msg)
return render_template(current_app.config["THEME_500_TEMPLATE"]), 500 return render_template(current_app.config["THEME_500_TEMPLATE"]), 500