1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-10 14:57:21 +08:00

Merge pull request #32299 from smoogipoo/fix-invalid-password-message

Fix error message on invalid room password
This commit is contained in:
Dean Herbert 2025-03-09 19:35:07 +09:00 committed by GitHub
commit 2c690b1139
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 5 deletions

View File

@ -9,5 +9,9 @@ namespace osu.Game.Online.Multiplayer
[Serializable] [Serializable]
public class InvalidPasswordException : HubException public class InvalidPasswordException : HubException
{ {
public InvalidPasswordException()
: base("Invalid password")
{
}
} }
} }

View File

@ -84,12 +84,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
onSuccess(room); onSuccess(room);
else else
{ {
const string message = "Failed to join multiplayer room."; Exception? exception = result.Exception?.AsSingular();
if (result.Exception != null) if (exception?.GetHubExceptionMessage() is string message)
Logger.Error(result.Exception, message); onFailure(message);
else
onFailure.Invoke(result.Exception?.AsSingular().Message ?? message); {
const string generic_failure_message = "Failed to join multiplayer room.";
if (result.Exception != null)
Logger.Error(result.Exception, generic_failure_message);
onFailure(generic_failure_message);
}
} }
}); });
} }