From 7289fe6e25537bd135ab89b70ed18a5d52668354 Mon Sep 17 00:00:00 2001 From: neuecc Date: Tue, 9 Jun 2020 11:26:03 +0900 Subject: [PATCH] ToCoroutine throws exception when error detected --- .../Plugins/UniTask/Runtime/UniTaskExtensions.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs index cf31092..f0cf2ac 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs @@ -621,9 +621,8 @@ namespace Cysharp.Threading.Tasks if (exception != null) { - // throw exception on iterator (main)thread. - // unfortunately unity test-runner can not handle throw exception on hand-write IEnumerator.MoveNext. - UnityEngine.Debug.LogException(exception.SourceException); + exception.Throw(); + return false; } return !completed; @@ -692,9 +691,8 @@ namespace Cysharp.Threading.Tasks if (exception != null) { - // throw exception on iterator (main)thread. - // unfortunately unity test-runner can not handle throw exception on hand-write IEnumerator.MoveNext. - UnityEngine.Debug.LogException(exception.SourceException); + exception.Throw(); + return false; } return !completed;