From 0a702bcdcd81bae0d05d029b15430ee5861b3277 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 29 Dec 2025 17:08:01 +0100 Subject: better logging of exceptions during rollback --- fietsboek/fstrans.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fietsboek/fstrans.py b/fietsboek/fstrans.py index c68ca48..13b0018 100644 --- a/fietsboek/fstrans.py +++ b/fietsboek/fstrans.py @@ -278,12 +278,19 @@ class Transaction: def undo(self): """Undo all actions that have already been applied.""" + # pylint: disable=broad-exception-caught for action in reversed(self.actions_done): LOGGER.debug("Undoing %s", action) try: action.undo() except Exception as exc_inner: - LOGGER.debug("Exception ignored: %s", exc_inner) + # Hide "during the handling of ... another exception occurred" + exc_inner.__context__ = None + LOGGER.exception( + "Exception ignored during rollback of %s", + action, + exc_info=exc_inner, + ) def commit(self, _trans): """Commit this transaction. -- cgit v1.2.3