diff --git a/InvenTree/plugin/helpers.py b/InvenTree/plugin/helpers.py index 3a42cdfd5d..e3af46c0e6 100644 --- a/InvenTree/plugin/helpers.py +++ b/InvenTree/plugin/helpers.py @@ -9,20 +9,6 @@ from django.conf import settings # region logging / errors -def log_error(error, reference: str = 'general'): - """ - Log an plugin error - """ - from plugin import registry - - # make sure the registry is set up - if reference not in registry.errors: - registry.errors[reference] = [] - - # add error to stack - registry.errors[reference].append(error) - - class IntegrationPluginError(Exception): """ Error that encapsulates another error and adds the path / reference of the raising plugin @@ -50,6 +36,20 @@ class MixinNotImplementedError(NotImplementedError): pass +def log_error(error, reference: str = 'general'): + """ + Log an plugin error + """ + from plugin import registry + + # make sure the registry is set up + if reference not in registry.errors: + registry.errors[reference] = [] + + # add error to stack + registry.errors[reference].append(error) + + def handle_error(error, do_raise: bool = True, do_log: bool = True, do_return: bool = False, log_name: str = ''): """ Handles an error and casts it as an IntegrationPluginError