Skip to content

Commit

Permalink
ToCoroutine throws exception when error detected
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Jun 9, 2020
1 parent 0c33977 commit 7289fe6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,8 @@ public bool MoveNext()

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;
Expand Down Expand Up @@ -692,9 +691,8 @@ public bool MoveNext()

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;
Expand Down

0 comments on commit 7289fe6

Please sign in to comment.