1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 04:41:54 +08:00

Add APIRequest.TriggerFailure() for testing

This commit is contained in:
smoogipoo
2020-07-31 20:55:26 +09:00
Unverified
parent 9966d4f3b3
commit 8e8a11bb72
+6 -1
View File
@@ -136,6 +136,11 @@ namespace osu.Game.Online.API
Success?.Invoke();
}
internal void TriggerFailure(Exception e)
{
Failure?.Invoke(e);
}
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
public void Fail(Exception e)
@@ -166,7 +171,7 @@ namespace osu.Game.Online.API
}
Logger.Log($@"Failing request {this} ({e})", LoggingTarget.Network);
pendingFailure = () => Failure?.Invoke(e);
pendingFailure = () => TriggerFailure(e);
checkAndScheduleFailure();
}