/// <summary> /// /// </summary> /// <param name="e"></param> protected static void OnUnhandledException(AsyncExceptionEventArgs e) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. var handler = AsyncException; // Event will be null if there are no subscribers if (handler != null) { // Use the () operator to raise the event. handler(null, e); } }
private static void AsyncException(object sender, AsyncExceptionEventArgs e) { e.Handled = _markExceptionsAsHandled; IncrementExceptionCounters(); //if (!_markExceptionsAsHandled) throw e.Exception; }