mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 13:32:54 +08:00
Improve user-facing error messages in room settings
This commit is contained in:
parent
3b0bf11366
commit
e4959489b7
@ -5,6 +5,7 @@ using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Extensions.ExceptionExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -299,7 +300,7 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer.Match
|
||||
if (t.IsCompletedSuccessfully)
|
||||
onSuccess(currentRoom.Value);
|
||||
else
|
||||
onError(t.Exception?.Message ?? "Error changing settings.");
|
||||
onError(t.Exception?.AsSingular().Message ?? "Error changing settings.");
|
||||
}));
|
||||
}
|
||||
else
|
||||
|
@ -7,6 +7,7 @@ using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.ExceptionExtensions;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
@ -91,11 +92,13 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
Schedule(() => onSuccess?.Invoke(room));
|
||||
else
|
||||
{
|
||||
const string message = "Failed to join multiplayer room.";
|
||||
|
||||
if (t.Exception != null)
|
||||
Logger.Error(t.Exception, "Failed to join multiplayer room.");
|
||||
Logger.Error(t.Exception, message);
|
||||
|
||||
PartRoom();
|
||||
Schedule(() => onError?.Invoke(t.Exception?.ToString() ?? string.Empty));
|
||||
Schedule(() => onError?.Invoke(t.Exception?.AsSingular().Message ?? message));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user