Always serialize exception names when logging/returning request exceptions.

This commit is contained in:
Fabio Manganiello 2023-07-22 15:13:17 +02:00
parent d49e5b1f6a
commit cef9d0e007
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -269,10 +269,14 @@ class Request(Message):
if response is None:
response = Response()
except (AssertionError, TimeoutError) as e:
error = e if str(e) else e.__class__.__name__
logger.warning(
'%s from action [%s]: %s', e.__class__.__name__, action, e
'%s from action [%s]: %s',
e.__class__.__name__,
action,
error,
)
response = Response(output=None, errors=[str(e)])
response = Response(output=None, errors=[error])
except Exception as e:
# Retry mechanism
plugin.logger.exception(e)