mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Fail requests taretting the fake API with a more deliberate exception
I think this feels better than relying on some other method to throw an exception.
This commit is contained in:
@ -65,9 +65,7 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
if (HandleRequest?.Invoke(request) != true)
|
if (HandleRequest?.Invoke(request) != true)
|
||||||
{
|
{
|
||||||
// this will fail due to not receiving an APIAccess, and trigger a failure on the request.
|
request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request."));
|
||||||
// this is intended - any request in testing that needs non-failures should use HandleRequest.
|
|
||||||
request.Perform(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user