From 82731cca8e44dc90e54813054d80afe2ac533895 Mon Sep 17 00:00:00 2001 From: Jack Spagnoli Date: Fri, 20 Mar 2026 10:50:03 +0000 Subject: [PATCH 1/2] defines ValidationError --- src/eps_spine_shared/errors.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/eps_spine_shared/errors.py b/src/eps_spine_shared/errors.py index c028017..902edbd 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, supplementaryInfo): + """ + Add supplementary information + """ + super(ValidationError, self).__init__(supplementaryInfo) + self.suppInfo = supplementaryInfo + + if on_spine: class EpsNoCredentialsErrorWithRetry: From 8b962a37de3a9ae5117790ca1349b503a4e6734d Mon Sep 17 00:00:00 2001 From: Jack Spagnoli Date: Fri, 20 Mar 2026 10:58:33 +0000 Subject: [PATCH 2/2] sonarcloud --- src/eps_spine_shared/errors.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eps_spine_shared/errors.py b/src/eps_spine_shared/errors.py index 902edbd..5ad88c3 100644 --- a/src/eps_spine_shared/errors.py +++ b/src/eps_spine_shared/errors.py @@ -37,12 +37,12 @@ class ValidationError(Exception): information to be appended to the error response text. """ - def __init__(self, supplementaryInfo): + def __init__(self, supplementary_info): """ Add supplementary information """ - super(ValidationError, self).__init__(supplementaryInfo) - self.suppInfo = supplementaryInfo + super(ValidationError, self).__init__(supplementary_info) + self.suppInfo = supplementary_info if on_spine: