Skip to content

Commit

Permalink
refactor: Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Feb 1, 2024
1 parent 7aaad7e commit c4c2f52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

async def main() -> None:
async with enka.EnkaAPI() as api:
response = await api.fetch_showcase(901211014)
try:
response = await api.fetch_showcase(901211014)
except enka.exceptions.PlayerDoesNotExistError:
return print("Player does not exist.")
except enka.exceptions.GameMaintenanceError:
return print("Game is in maintenance.")

print("Name:", response.player.nickname)
print("Level:", response.player.level)
Expand Down

0 comments on commit c4c2f52

Please sign in to comment.