mirror of
https://github.com/ppy/osu.git
synced 2025-03-10 03:57:20 +08:00
Fix error message on invalid room password
This commit is contained in:
parent
4344e083a7
commit
7fdadbd852
@ -9,5 +9,9 @@ namespace osu.Game.Online.Multiplayer
|
||||
[Serializable]
|
||||
public class InvalidPasswordException : HubException
|
||||
{
|
||||
public InvalidPasswordException()
|
||||
: base("Invalid password")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,12 +84,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
onSuccess(room);
|
||||
else
|
||||
{
|
||||
const string message = "Failed to join multiplayer room.";
|
||||
Exception? exception = result.Exception?.AsSingular();
|
||||
|
||||
if (result.Exception != null)
|
||||
Logger.Error(result.Exception, message);
|
||||
|
||||
onFailure.Invoke(result.Exception?.AsSingular().Message ?? message);
|
||||
if (exception?.GetHubExceptionMessage() is string message)
|
||||
onFailure(message);
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user