mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
feat: classify matchmaking recovery failures
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user