mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 09:02:55 +08:00
Handle unobserved exceptions from ready button properly
This commit is contained in:
parent
f800448c87
commit
7d9a61fbc1
@ -222,6 +222,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
// accessing Exception here silences any potential errors from the antecedent task
|
// accessing Exception here silences any potential errors from the antecedent task
|
||||||
if (t.Exception != null)
|
if (t.Exception != null)
|
||||||
{
|
{
|
||||||
|
t.CatchUnobservedExceptions(true); // will run immediately.
|
||||||
// gameplay was not started due to an exception; unblock button.
|
// gameplay was not started due to an exception; unblock button.
|
||||||
endOperation();
|
endOperation();
|
||||||
}
|
}
|
||||||
@ -232,8 +233,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.ToggleReady()
|
client.ToggleReady()
|
||||||
.ContinueWith(_ => endOperation())
|
.ContinueWith(t =>
|
||||||
.CatchUnobservedExceptions();
|
{
|
||||||
|
t.CatchUnobservedExceptions(true); // will run immediately.
|
||||||
|
endOperation();
|
||||||
|
});
|
||||||
|
|
||||||
void endOperation()
|
void endOperation()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user