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:
commit
2c690b1139
@ -8,6 +8,10 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class InvalidPasswordException : HubException
|
public class InvalidPasswordException : HubException
|
||||||
|
{
|
||||||
|
public InvalidPasswordException()
|
||||||
|
: base("Invalid password")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -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 (exception?.GetHubExceptionMessage() is string message)
|
||||||
|
onFailure(message);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const string generic_failure_message = "Failed to join multiplayer room.";
|
||||||
if (result.Exception != null)
|
if (result.Exception != null)
|
||||||
Logger.Error(result.Exception, message);
|
Logger.Error(result.Exception, generic_failure_message);
|
||||||
|
onFailure(generic_failure_message);
|
||||||
onFailure.Invoke(result.Exception?.AsSingular().Message ?? message);
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user