diff --git a/src/eps_spine_shared/errors.py b/src/eps_spine_shared/errors.py index c028017..5ad88c3 100644 --- a/src/eps_spine_shared/errors.py +++ b/src/eps_spine_shared/errors.py @@ -25,15 +25,26 @@ from spinecore.prescriptions.common.errors.errorbase1722 import ( # pyright: ignore[reportMissingImports] ErrorBase1722, ) - from spinecore.prescriptions.common.local_validator import ( # pyright: ignore[reportMissingImports] - ValidationError, - ) on_spine = True except ImportError: pass +class ValidationError(Exception): + """ + Exception to be raised by a validation method - needs to be passed supplementary + information to be appended to the error response text. + """ + + def __init__(self, supplementary_info): + """ + Add supplementary information + """ + super(ValidationError, self).__init__(supplementary_info) + self.suppInfo = supplementary_info + + if on_spine: class EpsNoCredentialsErrorWithRetry: