From a2a057440e87e5f494a8248f07f851e3a505d460 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 May 2022 16:05:32 +0900 Subject: [PATCH] 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. --- osu.Game/Online/API/DummyAPIAccess.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Online/API/DummyAPIAccess.cs b/osu.Game/Online/API/DummyAPIAccess.cs index f292e95bd1..8614cc79cb 100644 --- a/osu.Game/Online/API/DummyAPIAccess.cs +++ b/osu.Game/Online/API/DummyAPIAccess.cs @@ -65,9 +65,7 @@ namespace osu.Game.Online.API { if (HandleRequest?.Invoke(request) != true) { - // this will fail due to not receiving an APIAccess, and trigger a failure on the request. - // this is intended - any request in testing that needs non-failures should use HandleRequest. - request.Perform(this); + request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request.")); } }