private void AppDomainUnhandledException_EventHandler(Object sender, UnhandledExceptionEventArgs e) { System.Threading.ThreadAbortException tae = e.ExceptionObject as System.Threading.ThreadAbortException; if (null != tae) { Object o = tae.ExceptionState; if (null != o && o == this) { return; } } _numErrors++; Console.WriteLine("\nAn unhandled exception was thrown and not caught in the app domain: \n{0}", e.ExceptionObject); Console.WriteLine("Test FAILED!!!\n"); Environment.ExitCode = 101; }
void IThreadPoolWorkItem.MarkAborted(ThreadAbortException tae) /* nop */ }
public void MarkAborted(ThreadAbortException tae) { }
void IThreadPoolWorkItem.MarkAborted(ThreadAbortException tae) { }
/// <summary> /// Handles a <see cref="ThreadAbortException"/> if it is thrown because hard execution timeout. /// </summary> /// <param name="mayBeHardTimeoutException">A <see cref="ThreadAbortException"/> if it may be thrown because hard execution timeout.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="mayBeHardTimeoutException"/> is <c>null</c>. /// </exception> /// <exception cref="ThreadStateException"> /// <paramref name="mayBeHardTimeoutException"/> is not thrown on the current thread. /// </exception> protected internal void HandleThreadAbortException( ThreadAbortException mayBeHardTimeoutException ) { this._runtime.HandleThreadAbortException( mayBeHardTimeoutException ); }
private TestOutcome HandleAbort(MarkupDocumentWriter markupDocumentWriter, string actionDescription, ThreadAbortException ex) { TestOutcome outcome = abortOutcome.Value; if (ex == null && alreadyLoggedAbortOnce) return outcome; alreadyLoggedAbortOnce = true; LogMessage(markupDocumentWriter, actionDescription, outcome, abortMessage, null); return outcome; }
public void HandleThreadAbortException( ThreadAbortException mayBeHardTimeoutException ) { if ( mayBeHardTimeoutException == null ) { throw new ArgumentNullException( "mayBeHardTimeoutException" ); } Contract.EndContractBlock(); if ( RpcApplicationContext.HardTimeoutToken.Equals( mayBeHardTimeoutException.ExceptionState ) ) { try { ResetThreadAbort(); } catch ( SecurityException ) { } catch ( MemberAccessException ) { } } }
/// <summary> /// Initializes a new instance of the <see cref="ThreadAbortAlert" /> class. /// </summary> /// <param name="operationIdentity">The operation identity.</param> /// <param name="data">The data.</param> public ThreadAbortAlert(string operationIdentity, ThreadAbortException data = null) : base(GetFullMessage(FaultCode.ThreadAbortMessage, operationIdentity, Thread.CurrentThread.ManagedThreadId.ToString()), FaultCode.UnauthorizedOperation, data, null) { }