Skip to content
Snippets Groups Projects
Commit 5db856c6 authored by Antoine Pietri's avatar Antoine Pietri
Browse files

swh.core.api: add error logging for internal exceptions

parent d205359e
No related branches found
No related tags found
1 merge request!4swh.core.api: add error logging for internal exceptions
......@@ -4,6 +4,7 @@
# See top-level LICENSE file for more information
import json
import logging
import pickle
import requests
......@@ -97,6 +98,7 @@ def decode_request(request):
def error_handler(exception, encoder):
# XXX: this breaks language-independence and should be
# replaced by proper serialization of errors
logging.exception(exception)
response = encoder(pickle.dumps(exception))
response.status_code = 400
return response
......
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