diff --git a/eox_nelp/pearson_vue/pipeline.py b/eox_nelp/pearson_vue/pipeline.py index 6d313bae..805432c5 100644 --- a/eox_nelp/pearson_vue/pipeline.py +++ b/eox_nelp/pearson_vue/pipeline.py @@ -35,12 +35,16 @@ from eox_nelp.signals.utils import get_completed_and_graded try: - from eox_audit_model.decorators import audit_method + from eox_audit_model.decorators import audit_method, rename_function except ImportError: def audit_method(action): # pylint: disable=unused-argument """Identity audit_method""" return lambda x: x + def rename_function(name): # pylint: disable=unused-argument + """Identity rename_function""" + return lambda x: x + logger = logging.getLogger(__name__) @@ -491,9 +495,11 @@ def audit_pearson_error(failed_step_pipeline="", exception_dict=None, **kwargs): if not failed_step_pipeline: failed_step_pipeline = exception_dict.get("pipe_function") - audit_action = f"Pearson Vue Exception~{exception_dict['exception_type']}" + exception_title = ' '.join(word.capitalize() for word in exception_dict['exception_type'].split('-')) + audit_action = f"Pearson Vue Exception: {exception_title}" @audit_method(action=audit_action) + @rename_function(name=failed_step_pipeline) def raise_audit_pearson_exception(exception_dict, failed_step_pipeline): raise PearsonBaseError.from_dict(exception_dict)