linting
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m9s
Run linting on the backend code / Build (pull_request) Successful in 34s
Run testing on the backend code / Build (pull_request) Failing after 1m56s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 17s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m9s
Run linting on the backend code / Build (pull_request) Successful in 34s
Run testing on the backend code / Build (pull_request) Failing after 1m56s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 17s
This commit is contained in:
@@ -45,19 +45,19 @@ def fetch_landmark(client, landmark_uuid: str):
|
||||
logger.info(f'API Response: {json_data}')
|
||||
except ValueError as e:
|
||||
logger.error(f'Failed to parse response as JSON: {response.text}')
|
||||
raise HTTPException(status_code=500, detail="Invalid response format from API")
|
||||
raise HTTPException(status_code=500, detail="Invalid response format from API") from e
|
||||
|
||||
# Try validating against the Landmark model here to ensure consistency
|
||||
try:
|
||||
landmark = Landmark(**json_data)
|
||||
except ValidationError as ve:
|
||||
logging.error(f'Validation error: {ve}')
|
||||
raise HTTPException(status_code=500, detail="Invalid data format received from API")
|
||||
raise HTTPException(status_code=500, detail="Invalid data format received from API") from ve
|
||||
|
||||
if "detail" in json_data:
|
||||
raise HTTPException(status_code=500, detail=json_data["detail"])
|
||||
|
||||
return Landmark(**json_data)
|
||||
return landmark
|
||||
|
||||
|
||||
def fetch_landmark_cache(landmark_uuid: str):
|
||||
|
Reference in New Issue
Block a user