mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 10:22:56 +08:00
Standardise exception messages for local-user-logged-out flows
This commit is contained in:
parent
d9a43b4c4c
commit
62fa915193
@ -400,7 +400,7 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
if (state.Value == APIState.Offline)
|
||||
{
|
||||
request.Fail(new WebException("Disconnected from server"));
|
||||
failFromAPIOffline(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ namespace osu.Game.Online.API
|
||||
if (failOldRequests)
|
||||
{
|
||||
foreach (var req in oldQueueRequests)
|
||||
req.Fail(new WebException(@"Disconnected from server"));
|
||||
failFromAPIOffline(req);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -440,6 +440,13 @@ namespace osu.Game.Online.API
|
||||
flushQueue();
|
||||
}
|
||||
|
||||
private void failFromAPIOffline(APIRequest req)
|
||||
{
|
||||
Debug.Assert(state.Value == APIState.Offline);
|
||||
|
||||
req.Fail(new WebException(@"User not logged in"));
|
||||
}
|
||||
|
||||
private static APIUser createGuestUser() => new GuestUser();
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user