From 8479b135b5555fdc9bfb1e88997845050b11ce2a Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Wed, 17 Apr 2024 18:01:51 +0200 Subject: [PATCH] [FIX] queue_job: fix exception msg handling 'name' attributes for odoo's exception has been deprecated and produces a warning message. This commit fixes the behavior --- queue_job/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queue_job/controllers/main.py b/queue_job/controllers/main.py index a93c644841..4d1fc1683f 100644 --- a/queue_job/controllers/main.py +++ b/queue_job/controllers/main.py @@ -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) return { "exc_info": traceback_txt, "exc_name": exception_name,