Split exceptions back out to give better messaging

This commit is contained in:
Dean Herbert 2022-02-03 14:09:27 +09:00
parent 62fa915193
commit a69c7a9de6

View File

@ -400,7 +400,7 @@ namespace osu.Game.Online.API
{ {
if (state.Value == APIState.Offline) if (state.Value == APIState.Offline)
{ {
failFromAPIOffline(request); request.Fail(new WebException(@"User not logged in"));
return; return;
} }
@ -419,7 +419,7 @@ namespace osu.Game.Online.API
if (failOldRequests) if (failOldRequests)
{ {
foreach (var req in oldQueueRequests) foreach (var req in oldQueueRequests)
failFromAPIOffline(req); req.Fail(new WebException($@"Request failed from flush operation (state {state.Value})"));
} }
} }
} }
@ -440,13 +440,6 @@ namespace osu.Game.Online.API
flushQueue(); 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(); private static APIUser createGuestUser() => new GuestUser();
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)