public void SetExceptionHandler(ExceptionHandlerDelegate pMethod) { Monitor.Enter(this); if (m_delegateExceptionHandler == null) { m_delegateExceptionHandler = pMethod; } Monitor.Exit(this); }
public void Reset() { Stop(); enumerator = null; parent = null; returnValue = null; error = null; context = null; exceptionHandler = null; }
} //Use Routine.Create() private void Setup(IEnumerator enumerator, Routine parent, Object context, ExceptionHandlerDelegate exceptionHandler, System.Action onStop = null) { id = nextId++; Assert.IsTrue(nextId != ulong.MaxValue); returnValue = null; if (parent != null) { this.parent = parent; } this.enumerator = enumerator; this.context = context; this.exceptionHandler = exceptionHandler ?? Debug.LogException; this.onStop = onStop; }
internal static bool HandleAggregateException(Exception exception, ExceptionHandlerDelegate exceptionHandler, out ExceptionHandlingResult result) { if (!(exception is AggregateException)) { return exceptionHandler(exception, out result); } var ex = (AggregateException)exception; foreach (var current in ex.InnerExceptions) { if (HandleAggregateException(current, exceptionHandler, out result)) { return true; } } result = null; return false; }
public static T Try <T>(int howHard, Func <T> createFunc, ExceptionHandlerDelegate exceptionHandler) { var failCount = 0; while (true) { try { return(createFunc()); } catch (Exception e) { failCount++; var timeToThrow = failCount >= howHard; exceptionHandler?.Invoke(e, failCount, howHard, timeToThrow); if (timeToThrow) { throw; } } } }
public static void Try(int howHard, Action createAction, ExceptionHandlerDelegate exceptionHandler) { var failCount = 0; while (true) { try { createAction(); return; } catch (Exception e) { failCount++; var timeToThrow = failCount >= howHard; exceptionHandler?.Invoke(e, failCount, howHard, timeToThrow); if (timeToThrow) { throw; } } } }
public ApiGlobalExceptioinFilter(ExceptionHandlerDelegate exceptionHandler) { ExceptionHandler = exceptionHandler; }
public void Start(IEnumerable enumerable, Object context = null, ExceptionHandlerDelegate exceptionHandler = null, System.Action onStop = null) { Stop(); Setup(enumerable.GetEnumerator(), null, context, exceptionHandler, onStop); Step(); }
public static Options CatchClrExceptions(this Options options, ExceptionHandlerDelegate handler) { options.Interop.ExceptionHandler = handler; return(options); }