raise exception when not landmark in main
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m8s
Run linting on the backend code / Build (pull_request) Successful in 30s
Run testing on the backend code / Build (pull_request) Failing after 1m27s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 16s

This commit is contained in:
Helldragon67 2024-12-13 09:37:15 +01:00
parent b1b09ccf58
commit 291edcfc2a

View File

@ -133,7 +133,7 @@ def get_landmark(landmark_uuid: str) -> Landmark:
try:
landmark = cache_client.get(f"landmark_{landmark_uuid}")
if not isinstance(landmark, Landmark) :
raise ValueError(f"Object {landmark} is not of type Landmark")
raise HTTPException(status_code=500, detail=f"Object {landmark} is not of type Landmark")
return landmark
except KeyError as exc:
raise HTTPException(status_code=404, detail="Landmark not found") from exc