From 073fe1a08bd00c911d2a8bbfb41de2ca9b853cc7 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Fri, 7 Jul 2023 15:35:54 +0200 Subject: [PATCH] frappy.io: make error reporting consistent - fix mechanism to avoid multiple error messages in log files Change-Id: I688071f9b06da1a81eb12d63adb549042171c7c8 --- frappy/io.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappy/io.py b/frappy/io.py index 3201963..53de4bd 100644 --- a/frappy/io.py +++ b/frappy/io.py @@ -170,8 +170,8 @@ class IOBase(Communicator): self.callCallbacks() return self.is_connected except Exception as e: - if str(e) != self._last_error: - self._last_error = str(e) + if repr(e) != self._last_error: + self._last_error = repr(e) self.log.error(self._last_error) raise SilentError(repr(e)) from e return self.is_connected @@ -324,7 +324,7 @@ class StringIO(IOBase): if self._conn is None: raise SilentError('disconnected') from None if repr(e) != self._last_error: - self._last_error = str(e) + self._last_error = repr(e) self.log.error(self._last_error) raise SilentError(repr(e)) from e