exception testing

This commit is contained in:
neuecc
2020-05-10 22:44:40 +09:00
parent af6dbd8868
commit 93dd82e3d4
17 changed files with 926 additions and 3963 deletions

View File

@@ -31,6 +31,21 @@ namespace Cysharp.Threading.Tasks.Linq
{
completionSource.GetResult(token);
}
protected bool TryGetResult<T>(UniTask<T>.Awaiter awaiter, out T result)
{
try
{
result = awaiter.GetResult();
return true;
}
catch (Exception ex)
{
completionSource.TrySetException(ex);
result = default;
return false;
}
}
}