Add support for Result fetching

This commit is contained in:
Dean Herbert
2020-04-11 18:02:43 +09:00
parent 832822858c
commit 415adecdf6
2 changed files with 13 additions and 3 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using Newtonsoft.Json;
using osu.Framework.IO.Network;
using osu.Framework.Logging;
@ -98,10 +99,15 @@ namespace osu.Game.Online.API
{
if (cancelled) return;
Success?.Invoke();
TriggerSuccess();
});
}
internal void TriggerSuccess()
{
Success?.Invoke();
}
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
public void Fail(Exception e)