Skip to content

Commit

Permalink
[Logging] fix double callback call for exception details
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 13, 2024
1 parent a1008dc commit d77c7d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion octobot_commons/logging/logging_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def exception(
:param skip_post_callback: when True, the error callback wont be called
"""
extra = kwargs.get("extra", {})
origin_error_message = error_message
error_message = (
self._process_log_callback(error_message)
if error_message
Expand All @@ -237,7 +238,7 @@ def exception(
extra[constants.EXCEPTION_DESC] = error_message
self.logger.exception(exception, extra=extra, **kwargs)
if publish_error_if_necessary:
message = error_message
message = origin_error_message
if message is None:
message = (
str(exception) if str(exception) else exception.__class__.__name__
Expand Down

0 comments on commit d77c7d4

Please sign in to comment.