diff --git a/swh/core/api/asynchronous.py b/swh/core/api/asynchronous.py --- a/swh/core/api/asynchronous.py +++ b/swh/core/api/asynchronous.py @@ -70,11 +70,11 @@ except Exception as e: if isinstance(e, aiohttp.web.HTTPException): raise - logger.exception(e) - res = exception_to_dict(e) if isinstance(e, app.client_exception_classes): status = 400 else: + logger.exception(e) + res = exception_to_dict(e) status = 500 return encode_data_server(res, status=status)