1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Add APIRequest.TriggerFailure() for testing

This commit is contained in:
smoogipoo 2020-07-31 20:55:26 +09:00
parent 9966d4f3b3
commit 8e8a11bb72

View File

@ -136,6 +136,11 @@ namespace osu.Game.Online.API
Success?.Invoke(); Success?.Invoke();
} }
internal void TriggerFailure(Exception e)
{
Failure?.Invoke(e);
}
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled")); public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
public void Fail(Exception e) public void Fail(Exception e)
@ -166,7 +171,7 @@ namespace osu.Game.Online.API
} }
Logger.Log($@"Failing request {this} ({e})", LoggingTarget.Network); Logger.Log($@"Failing request {this} ({e})", LoggingTarget.Network);
pendingFailure = () => Failure?.Invoke(e); pendingFailure = () => TriggerFailure(e);
checkAndScheduleFailure(); checkAndScheduleFailure();
} }