From cef9d0e0074d4e50e2bb9b1ff74cd68b9ac08b43 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 22 Jul 2023 15:13:17 +0200 Subject: [PATCH] Always serialize exception names when logging/returning request exceptions. --- platypush/message/request/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index 58e5bbbd22..7ada15eaff 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -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)