Skip to content

Commit

Permalink
[FIX] queue_job: fix exception msg handling
Browse files Browse the repository at this point in the history
'name' attributes for odoo's exception has been deprecated and produces a warning message. This commit fixes the behavior
  • Loading branch information
benwillig committed May 30, 2024
1 parent 0dfd54f commit 8479b13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queue_job/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _get_failure_values(self, job, traceback_txt, orig_exception):
exception_name = orig_exception.__class__.__name__
if hasattr(orig_exception, "__module__"):
exception_name = orig_exception.__module__ + "." + exception_name
exc_message = getattr(orig_exception, "name", str(orig_exception))
exc_message = orig_exception.args[0] if orig_exception.args else str(orig_exception)

Check warning on line 163 in queue_job/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

queue_job/controllers/main.py#L163

Added line #L163 was not covered by tests
return {
"exc_info": traceback_txt,
"exc_name": exception_name,
Expand Down

0 comments on commit 8479b13

Please sign in to comment.