diff --git a/eveai_app/errors.py b/eveai_app/errors.py index 4c6f0ec..f726feb 100644 --- a/eveai_app/errors.py +++ b/eveai_app/errors.py @@ -1,4 +1,4 @@ -from flask import render_template, request, jsonify, redirect +from flask import render_template, request, jsonify, redirect, current_app from flask_login import current_user from common.utils.nginx_utils import prefixed_url_for @@ -6,24 +6,28 @@ from common.utils.nginx_utils import prefixed_url_for def not_found_error(error): if not current_user.is_authenticated: return redirect(prefixed_url_for('security.login')) + current_app.logger.error(f"Not Found Error: {error}") return render_template('error/404.html'), 404 def internal_server_error(error): if not current_user.is_authenticated: return redirect(prefixed_url_for('security.login')) + current_app.logger.error(f"Internal Server Error: {error}") return render_template('error/500.html'), 500 def not_authorised_error(error): if not current_user.is_authenticated: return redirect(prefixed_url_for('security.login')) + current_app.logger.error(f"Not Authorised Error: {error}") return render_template('error/401.html') def access_forbidden(error): if not current_user.is_authenticated: return redirect(prefixed_url_for('security.login')) + current_app.logger.error(f"Access Forbidden: {error}") return render_template('error/403.html') @@ -32,6 +36,7 @@ def key_error_handler(error): if str(error) == "'tenant'": return redirect(prefixed_url_for('security.login')) # For other KeyErrors, you might want to log the error and return a generic error page + current_app.logger.error(f"Key Error: {error}") return render_template('error/generic.html', error_message="An unexpected error occurred"), 500 diff --git a/eveai_app/templates/document/library_operations.html b/eveai_app/templates/document/library_operations.html index e1f732c..97152f7 100644 --- a/eveai_app/templates/document/library_operations.html +++ b/eveai_app/templates/document/library_operations.html @@ -10,6 +10,17 @@