Skip to content

Commit

Permalink
fix: Retry on 503 from Mojang
Browse files Browse the repository at this point in the history
Experienced this in a game today :^)
  • Loading branch information
Amund211 committed Jan 4, 2025
1 parent e7add6c commit 28a9d58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/prism/mojang.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def _make_request(
"Request to Mojang API failed due to an unknown error"
) from e

if response.status_code == 429 or response.status_code == 504 and not last_try:
if (
response.status_code == 429
or response.status_code == 503
or response.status_code == 504
) and not last_try:
raise ExecutionError("Request to Mojang API failed due to rate limit, retrying")

return response
Expand Down

0 comments on commit 28a9d58

Please sign in to comment.