Skip to content

Commit

Permalink
HAN-50: improve error handling in plant service access
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustinefe committed Mar 10, 2024
1 parent 6a238aa commit 3398849
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/service/plant_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ async def get_plant_type(botanical_name: str) -> Optional[PlantTypeSchema]:
else:
return response.raise_for_status().json()

except Exception as e:
except HTTPStatusError as e:
logger.error(
"Plant service cannot be accessed because: " + str(e)
)
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="Plant service service cannot be accessed",
status_code=e.response.status_code,
detail=e.response.content,
)

0 comments on commit 3398849

Please sign in to comment.