mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Add APIRequest.TriggerFailure() for testing
This commit is contained in:
parent
9966d4f3b3
commit
8e8a11bb72
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user