Skip to content

Commit

Permalink
Fixed wrong exception type in PathLocations.add
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Oct 15, 2024
1 parent 32b63d6 commit b644d58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nlds/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}"
)
Expand Down

0 comments on commit b644d58

Please sign in to comment.