From b644d58ec5423e7148560e49ac6a8b35965fccc0 Mon Sep 17 00:00:00 2001 From: Neil Massey Date: Tue, 15 Oct 2024 10:23:42 +0100 Subject: [PATCH] Fixed wrong exception type in PathLocations.add --- nlds/details.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nlds/details.py b/nlds/details.py index 5fba1799..28f76e6b 100644 --- a/nlds/details.py +++ b/nlds/details.py @@ -21,6 +21,7 @@ from nlds.utils.permissions import check_permissions import nlds.rabbit.message_keys as MSG +from nlds.errors import MessageError # Patch the JSONEncoder so that a custom json serialiser can be run instead of # of the default, if one exists. This patches for ALL json.dumps calls. @@ -93,7 +94,7 @@ class PathLocations(BaseModel): def add(self, location: PathLocation) -> None: if location.storage_type in self.locations: - raise PathDetailsError( + raise MessageError( f"PathLocations already contains a PathLocation of the type " f"{location.storage_type}" )