Skip to content

Commit

Permalink
Log exceptions in robots api
Browse files Browse the repository at this point in the history
  • Loading branch information
anetteu committed Feb 24, 2022
1 parent 90617d1 commit 84d98c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/flotilla/api/robots_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def get_robot(
db_robot: RobotDBModel = read_robot_by_id(db=db, robot_id=robot_id)
robot: Robot = db_robot.get_api_robot()
except DBException:
logger.error(f"Could not get robot with id {robot_id}.")
logger.exception(f"Could not get robot with id {robot_id}.")
response.status_code = HTTPStatus.NOT_FOUND.value
return ProblemDetails(
title=NOT_FOUND_DESCRIPTION, status=HTTPStatus.NOT_FOUND.value
Expand Down Expand Up @@ -111,7 +111,7 @@ async def post_start_robot(
report_status=ReportStatus.in_progress,
)
except DBException:
logger.error(f"Could not get robot with id {robot_id}.")
logger.exception(f"Could not get robot with id {robot_id}.")
response.status_code = HTTPStatus.NOT_FOUND.value
return ProblemDetails(title=NOT_FOUND_DESCRIPTION)
except HTTPError as e:
Expand Down Expand Up @@ -152,7 +152,7 @@ async def post_stop_robot(
host=robot.host, port=robot.port
)
except DBException:
logger.error(f"Could not get robot with id {robot_id}.")
logger.exception(f"Could not get robot with id {robot_id}.")
response.status_code = HTTPStatus.NOT_FOUND.value
return ProblemDetails(title=NOT_FOUND_DESCRIPTION)
except HTTPError as e:
Expand Down

0 comments on commit 84d98c7

Please sign in to comment.