Skip to content
Snippets Groups Projects
Commit d0ceba8d authored by Arie Peterson's avatar Arie Peterson
Browse files

Log exceptions in application code

parent cb0b2f21
No related branches found
No related tags found
1 merge request!215Resolve "Kratos hooks have broken imports"
Pipeline #47776 passed with stages
in 3 minutes and 53 seconds
from flask import jsonify
from jsonschema import ValidationError
import logging
import traceback
class KratosError(Exception):
......@@ -43,6 +45,8 @@ def hydra_error(e):
def global_error(e):
message = str(e)
trace = traceback.format_exception(e)
logging.warning(f"Error in application code: {trace}")
return jsonify({"errorMessage": message}), 500
def unauthorized_error(e):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment