public static CoroutineException MakeException <IterationType>(CoroutineException innerGraphException, IEnumerator <IterationType> newFrameIterator) { using (AssemblyCache cache = new AssemblyCache()) { return(new CoroutineException(innerGraphException, Frame.MakeFrame(cache, newFrameIterator))); } }
/// <summary> /// Initializing constructor - parses the original exception and matches it up with the graph info passed in /// </summary> public CoroutineException(CoroutineException innerGraphException, Frame newFrame) : base(innerGraphException.Message) { var frames = new List <Frame>(innerGraphException.Trace.Frames); frames.Add(newFrame); _Trace = new Trace(frames); }
IEnumerator StartCoroutineInternal(IEnumerator coroutine) { while (true) { try { if (!coroutine.MoveNext()) yield break; } catch (Exception e) { string message = "Coroutine Exception: " + e.Message; CoroutineException error = new CoroutineException(message, e); Debug.LogException(error); yield break; } yield return coroutine.Current; } }