Skip to content

Commit

Permalink
Prevent thread crashing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jan 9, 2024
1 parent f3a3fc3 commit 7224016
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/isar_exr/api/energy_robotics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,14 @@ def get_current_site_stage(self, site_id: str) -> str:
response_dict: dict[str, Any] = self.client.query(
dsl_gql(current_site_stage_query), params
)

if response_dict["currentSiteStage"] is not None:
return response_dict["currentSiteStage"]["id"]
except Exception as e:
message: str = "Could not get current site stage"
self.logger.error(message)
raise RobotAPIException(
error_description=message,
)
if response_dict["currentSiteStage"] is not None:
return response_dict["currentSiteStage"]["id"]

return None

0 comments on commit 7224016

Please sign in to comment.