Skip to content

Commit

Permalink
Fix incorrect return type from get_team.
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jvessella committed Feb 20, 2024
1 parent bc4b42e commit 94e9f02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gamebrain/clients/gameboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,16 @@ class TeamDoesNotExist(Exception):

async def get_team(team_id: str) -> TeamData | None:
try:
return await _gameboard_get(f"teams/{team_id}")
data = await _gameboard_get(f"teams/{team_id}")
return TeamData(**data)
except RequestFailure as e:
if e.status_code == 400:
raise TeamDoesNotExist
else:
return None
except ValidationError as e:
error(e)
return None


async def get_teams(game_id: str):
Expand Down

0 comments on commit 94e9f02

Please sign in to comment.