From 26b9371f26e28a9f8fc05afc074864115d723ba0 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 17 Sep 2020 18:33:56 -0700 Subject: [PATCH] When @transaction rolls back, log the name of the called method. --- etiquette/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etiquette/decorators.py b/etiquette/decorators.py index a4bbe79..67de674 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -86,8 +86,8 @@ def transaction(method): try: result = method(self, *args, **kwargs) - except Exception as e: - photodb.log.debug(e) + except Exception as exc: + photodb.log.debug(f'{method} raised {repr(exc)}') photodb.rollback(savepoint=savepoint_id) raise