diff --git a/InvenTree/InvenTree/tasks.py b/InvenTree/InvenTree/tasks.py index 036ac98796..4356509e12 100644 --- a/InvenTree/InvenTree/tasks.py +++ b/InvenTree/InvenTree/tasks.py @@ -180,6 +180,8 @@ def offload_task( Returns: bool: True if the task was offloaded (or ran), False otherwise """ + from InvenTree.exceptions import log_error + try: import importlib @@ -213,6 +215,7 @@ def offload_task( return False except Exception as exc: raise_warning(f"WARNING: '{taskname}' not offloaded due to {str(exc)}") + log_error('InvenTree.offload_task') return False else: if callable(taskname): @@ -233,6 +236,7 @@ def offload_task( try: _mod = importlib.import_module(app_mod) except ModuleNotFoundError: + log_error('InvenTree.offload_task') raise_warning( f"WARNING: '{taskname}' not started - No module named '{app_mod}'" ) @@ -249,6 +253,7 @@ def offload_task( if not _func: _func = eval(func) # pragma: no cover except NameError: + log_error('InvenTree.offload_task') raise_warning( f"WARNING: '{taskname}' not started - No function named '{func}'" ) @@ -258,6 +263,7 @@ def offload_task( try: _func(*args, **kwargs) except Exception as exc: + log_error('InvenTree.offload_task') raise_warning(f"WARNING: '{taskname}' not started due to {str(exc)}") return False