Skip to content

Commit ba22c61

Browse files
committed
Add pulp-glue exceptions handling
1 parent 0d3fa50 commit ba22c61

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pulpcore/tasking/tasks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
TASK_WAKEUP_HANDLE,
3131
TASK_WAKEUP_UNBLOCK,
3232
)
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+
3636
from pulpcore.middleware import x_task_diagnostics_var
3737
from pulpcore.tasking.kafka import send_task_notification
3838

@@ -74,7 +74,7 @@ def _execute_task(task):
7474
log_task_start(task, domain)
7575
task_function = get_task_function(task)
7676
result = task_function()
77-
except PulpException:
77+
except (PulpException, PulpGlueException):
7878
exc_type, exc, _ = sys.exc_info()
7979
log_task_failed(task, exc_type, exc, None, domain) # Leave no traceback in logs
8080
task.set_failed(exc)
@@ -106,7 +106,7 @@ async def _aexecute_task(task):
106106
try:
107107
task_coroutine_fn = await aget_task_function(task)
108108
result = await task_coroutine_fn()
109-
except PulpException:
109+
except (PulpException, PulpGlueException):
110110
exc_type, exc, _ = sys.exc_info()
111111
log_task_failed(task, exc_type, exc, None, domain) # Leave no traceback in logs
112112
await sync_to_async(task.set_failed)(exc)

0 commit comments

Comments
 (0)