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
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:
parent
b1b09ccf58
commit
291edcfc2a
@ -133,7 +133,7 @@ def get_landmark(landmark_uuid: str) -> Landmark:
|
|||||||
try:
|
try:
|
||||||
landmark = cache_client.get(f"landmark_{landmark_uuid}")
|
landmark = cache_client.get(f"landmark_{landmark_uuid}")
|
||||||
if not isinstance(landmark, Landmark) :
|
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
|
return landmark
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
raise HTTPException(status_code=404, detail="Landmark not found") from exc
|
raise HTTPException(status_code=404, detail="Landmark not found") from exc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user