Skip to content

Commit ac9ac15

Browse files
committed
Removed handling of 400 Bad Request and replaced it with ValidationError
1 parent fd7e082 commit ac9ac15

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Assets/BossRoom/Scripts/Client/UI/UnityServicesUIHandler.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ void HandleLobbyError(UnityServiceErrorMessage error)
5555
switch (exception.Reason)
5656
{
5757
// If the error is one of the following, the player needs to know about it, so show in a popup message. Otherwise, the log in the console is sufficient.
58+
case LobbyExceptionReason.ValidationError:
59+
PopupPanel.ShowPopupPanel("Validation Error", "Validation check failed on Lobby. Is the join code correctly formatted?");
60+
break;
61+
case LobbyExceptionReason.LobbyNotFound:
62+
PopupPanel.ShowPopupPanel("Lobby Not Found", "Requested lobby not found. The join code is incorrect or the lobby has ended.");
63+
break;
5864
case LobbyExceptionReason.LobbyConflict:
5965
// LobbyConflict can have multiple causes. Let's add other solutions here if there's other situations that arise for this.
6066
Debug.LogError($"Got service error {error.Message} with LobbyConflict. Possible conflict cause: Trying to play with two builds on the " +
6167
$"same machine. Please use command line arg '{ProfileManager.AuthProfileCommandLineArg} someName' to set a different auth profile.\n");
62-
PopupPanel.ShowPopupPanel("Failed to join Lobby due to a conflict", "See logs for more details.");
63-
break;
64-
case LobbyExceptionReason.LobbyNotFound:
65-
PopupPanel.ShowPopupPanel("Lobby Not Found", "Requested lobby not found. See logs for details.");
68+
PopupPanel.ShowPopupPanel("Failed to join Lobby", "Failed to join Lobby due to a conflict. See logs for more details.");
6669
break;
6770
case LobbyExceptionReason.NoOpenLobbies:
6871
PopupPanel.ShowPopupPanel("Failed to join Lobby", "No accessible lobbies are currently available for quick-join.");
@@ -71,13 +74,10 @@ void HandleLobbyError(UnityServiceErrorMessage error)
7174
PopupPanel.ShowPopupPanel("Failed to join Lobby", "Lobby is full and can't accept more players.");
7275
break;
7376
case LobbyExceptionReason.Unauthorized:
74-
PopupPanel.ShowPopupPanel("Lobby error", "Unauthorized.");
77+
PopupPanel.ShowPopupPanel("Lobby error", "Received HTTP error 401 Unauthorized from Lobby Service.");
7578
break;
7679
case LobbyExceptionReason.RequestTimeOut:
77-
PopupPanel.ShowPopupPanel("Lobby error", "Request timed out.");
78-
break;
79-
case LobbyExceptionReason.BadRequest:
80-
PopupPanel.ShowPopupPanel("Lobby error", "Received HTTP error 400 Bad Request from Lobby Service. Is the join code correctly formatted?");
80+
PopupPanel.ShowPopupPanel("Lobby error", "Received HTTP error 408 Request timed out from Lobby Service.");
8181
break;
8282
}
8383
}

0 commit comments

Comments
 (0)