📣 An issue occured with the embedded container registry on October 25 2021, between 10:30 and 12:10 (UTC+2). Any persisting issues should be reported to CC-IN2P3 Support. 🐛

Commit c32dc127 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update directsvc.JSONEncoder to handle application exception.

parent 0ca6d35d
......@@ -20,6 +20,7 @@ PROC_KEY = "%s.%s"
class JSONEncoder(json.JSONEncoder):
"""Add to the standard JSON encoder:
- Exception
- date
- datetime
- lazyT
......@@ -65,7 +66,7 @@ class JSONEncoder(json.JSONEncoder):
datetime.time)):
return obj.isoformat().replace("T", " ")
elif isinstance(obj, lazyT):
elif isinstance(obj, (lazyT, Exception)):
return str(obj)
return json.JSONEncoder.default(self, obj)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment