From af82a94b875328241858a5b3c64743033a327f47 Mon Sep 17 00:00:00 2001 From: neuecc Date: Thu, 18 Jun 2020 03:30:53 +0900 Subject: [PATCH] Fix TimeoutWithoutException does not suppress exception --- .../Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs index 7833b3e..cf041a5 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs @@ -315,7 +315,7 @@ namespace Cysharp.Threading.Tasks taskCancellationTokenSource.Dispose(); } - throw new TimeoutException("Exceed Timeout:" + timeout); + return true; } else { @@ -325,7 +325,7 @@ namespace Cysharp.Threading.Tasks if (taskResultIsCanceled) { - Error.ThrowOperationCanceledException(); + return true; } return false; @@ -361,7 +361,7 @@ namespace Cysharp.Threading.Tasks taskCancellationTokenSource.Dispose(); } - throw new TimeoutException("Exceed Timeout:" + timeout); + return (true, default); } else { @@ -371,7 +371,7 @@ namespace Cysharp.Threading.Tasks if (taskResult.IsCanceled) { - Error.ThrowOperationCanceledException(); + return (true, default); } return (false, taskResult.Result);