Skip to content

Commit 1f561d8

Browse files
Fix logging exception in actor decorator
The exception information is added by default when calling logger.exception and it is redundant to re-add it in the message. Signed-off-by: Daniel Zullo <[email protected]>
1 parent c3fbe59 commit 1f561d8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/frequenz/sdk/actor/_decorator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ async def _start_actor(self) -> None:
207207
except asyncio.CancelledError:
208208
logger.debug("Cancelling actor: %s", cls.__name__)
209209
raise
210-
except Exception as err: # pylint: disable=broad-except
211-
logger.exception(
212-
"Actor (%s) crashed with error: %s", cls.__name__, err
213-
)
210+
except Exception: # pylint: disable=broad-except
211+
logger.exception("Actor (%s) crashed", cls.__name__)
214212
if (
215213
self.restart_limit is None
216214
or number_of_restarts < self.restart_limit

0 commit comments

Comments
 (0)