feat: classify matchmaking recovery failures

This commit is contained in:
Josh Creek
2026-08-31 22:45:20 +01:00
parent fddbebb33b
commit 222bbb5b84
4 changed files with 26 additions and 2 deletions
+10 -1
View File
@@ -140,8 +140,17 @@ func _on_request_completed(result: HTTPRequest.Result, response_code: int, _head
return
if response_code < 200 or response_code >= 300:
var detail := String(parsed.get("error", "request rejected"))
if operation == "ranked_profile":
if response_code == HTTPClient.RESPONSE_UNAUTHORIZED:
state.fail("Session expired; sign in again")
ranked_profile.set_error("Session expired; sign in again")
elif response_code == HTTPClient.RESPONSE_GONE and operation == "queue_recover":
state.expire("Queue ticket expired")
elif response_code == HTTPClient.RESPONSE_SERVICE_UNAVAILABLE:
state.set_notice("Matchmaking is temporarily unavailable; retrying is safe")
elif operation == "ranked_profile":
ranked_profile.set_error(detail)
elif response_code == HTTPClient.RESPONSE_NOT_FOUND and (operation == "queue_recover" or operation == "proposal_recover"):
state.fail("Matchmaking record is no longer available")
elif operation == "queue_create" or operation == "queue_recover" or operation == "proposal_recover":
state.fail(detail)
else: