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 10, 2024
1 parent 465342e commit 3b314c7
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 @@ -776,12 +776,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 3b314c7

Please sign in to comment.