|
30 | 30 | TASK_WAKEUP_HANDLE, |
31 | 31 | TASK_WAKEUP_UNBLOCK, |
32 | 32 | ) |
33 | | -from pulpcore.exceptions.base import ( |
34 | | - PulpException, |
35 | | -) |
| 33 | +from pulpcore.exceptions.base import PulpException |
| 34 | +from pulp_glue.common.exceptions import PulpException as PulpGlueException |
| 35 | + |
36 | 36 | from pulpcore.middleware import x_task_diagnostics_var |
37 | 37 | from pulpcore.tasking.kafka import send_task_notification |
38 | 38 |
|
@@ -74,7 +74,7 @@ def _execute_task(task): |
74 | 74 | log_task_start(task, domain) |
75 | 75 | task_function = get_task_function(task) |
76 | 76 | result = task_function() |
77 | | - except PulpException: |
| 77 | + except (PulpException, PulpGlueException): |
78 | 78 | exc_type, exc, _ = sys.exc_info() |
79 | 79 | log_task_failed(task, exc_type, exc, None, domain) # Leave no traceback in logs |
80 | 80 | task.set_failed(exc) |
@@ -106,7 +106,7 @@ async def _aexecute_task(task): |
106 | 106 | try: |
107 | 107 | task_coroutine_fn = await aget_task_function(task) |
108 | 108 | result = await task_coroutine_fn() |
109 | | - except PulpException: |
| 109 | + except (PulpException, PulpGlueException): |
110 | 110 | exc_type, exc, _ = sys.exc_info() |
111 | 111 | log_task_failed(task, exc_type, exc, None, domain) # Leave no traceback in logs |
112 | 112 | await sync_to_async(task.set_failed)(exc) |
|
0 commit comments