// Token: 0x0600016F RID: 367 RVA: 0x00009B94 File Offset: 0x00007D94
 internal void Shutdown()
 {
     if (this.synchronizeTask != null)
     {
         try
         {
             if (!this.synchronizeTask.Wait(30000))
             {
                 this.cancellationTokenSource.Cancel();
                 this.synchronizeTask.Wait(30000);
             }
         }
         catch (AggregateException ex)
         {
             if (ex.InnerException != null)
             {
                 if (!(ex.InnerException is LocalizedException) && GrayException.IsGrayException(ex.InnerException))
                 {
                     ExWatson.SendReport(ex.InnerException, ReportOptions.None, null);
                 }
                 SearchEventLogger.Instance.LogFailedToSyncDiscoveryHoldToExchangeOnlineEvent(ex.InnerException);
             }
         }
         finally
         {
             if (this.synchronizeTask.IsCompleted)
             {
                 this.synchronizeTask.Dispose();
                 this.cancellationTokenSource.Dispose();
             }
             this.synchronizeTask         = null;
             this.cancellationTokenSource = null;
         }
     }
 }
Ejemplo n.º 2
0
 // Token: 0x06007276 RID: 29302 RVA: 0x0017B2BC File Offset: 0x001794BC
 private CostHandle(Budget budget, Action <CostHandle> releaseAction, string description, TimeSpan preCharge)
 {
     if (budget == null)
     {
         throw new ArgumentNullException("budget");
     }
     if (string.IsNullOrEmpty(description))
     {
         ExWatson.SendReport(new ArgumentNullException("cost handle description is null or empty"), ReportOptions.DoNotCollectDumps | ReportOptions.DeepStackTraceHash, null);
     }
     if (preCharge < TimeSpan.Zero)
     {
         throw new ArgumentException("preCharge cannot be a negative timespan", "preCharge");
     }
     this.Budget        = budget;
     this.Key           = Interlocked.Increment(ref CostHandle.nextKey);
     this.StartTime     = TimeProvider.UtcNow - preCharge;
     this.PreCharge     = preCharge;
     this.ReleaseAction = releaseAction;
     this.Budget.AddOutstandingAction(this);
     this.DisposedByThread = -1;
     this.DisposedAt       = DateTime.MinValue;
     this.Description      = description;
     this.MaxLiveTime      = Budget.GetMaxActionTime(this.CostType);
 }
Ejemplo n.º 3
0
            public override Guid GetExternalDirectoryOrganizationId(LoadBalancingMiniRecipient recipient)
            {
                if (recipient.OrganizationId == OrganizationId.ForestWideOrgId)
                {
                    return(TenantPartitionHint.ExternalDirectoryOrganizationIdForRootOrg);
                }
                string text;

                try
                {
                    text = recipient.OrganizationId.ToExternalDirectoryOrganizationId();
                }
                catch (InvalidOperationException ex)
                {
                    string extraData = string.Format("OrgId: {0}, recipientGuid: {1}, database: {2}", recipient.OrganizationId.GetTenantGuid(), recipient.ExchangeObjectId, recipient.Database);
                    ExWatson.SendReport(ex, ReportOptions.None, extraData);
                    throw new InvalidOrganizationException(recipient.OrganizationId.ToString(), ex);
                }
                Guid result;

                if (!Guid.TryParse(text, out result))
                {
                    throw new InvalidOrganizationIdentityException(string.Format("{0}", recipient.OrganizationId), text);
                }
                return(result);
            }
Ejemplo n.º 4
0
        internal static bool CatchNonFatalExceptions(Action action, string diagnosticsDataToLog = null)
        {
            bool result = false;

            try
            {
                action();
            }
            catch (Exception ex)
            {
                if (ex is OutOfMemoryException || ex is StackOverflowException || ex is ThreadAbortException)
                {
                    throw;
                }
                result = true;
                diagnosticsDataToLog = (diagnosticsDataToLog ?? string.Empty);
                if (!(ex is StoragePermanentException) && !(ex is StorageTransientException))
                {
                    ReportOptions options = ActivityLoggingConfig.Instance.IsDumpCollectionEnabled ? ReportOptions.None : ReportOptions.DoNotCollectDumps;
                    ExWatson.SendReport(ex, options, diagnosticsDataToLog);
                }
                InferenceDiagnosticsLog.Log("CatchNonFatalExceptions", new List <string>
                {
                    diagnosticsDataToLog,
                    ex.ToString()
                });
            }
            return(result);
        }
Ejemplo n.º 5
0
 private void reportButton_Click(object sender, EventArgs e)
 {
     using (new ControlWaitCursor(this))
     {
         ExWatson.SendReport(this.Exception);
     }
 }
        private void ForwardKnownExceptions(Action operation, Func <Exception, bool> ignoreExceptionOperation = null)
        {
            Exception failure = null;

            try
            {
                CommonUtils.CatchKnownExceptions(operation, delegate(Exception f)
                {
                    failure = f;
                });
            }
            catch (Exception ex)
            {
                MrsTracer.Service.Error("Unhandled exception in MRS:\n{0}\n{1}", new object[]
                {
                    CommonUtils.FullExceptionMessage(ex),
                    ex.StackTrace
                });
                ExWatson.SendReport(ex);
                throw;
            }
            if (failure != null && (ignoreExceptionOperation == null || !ignoreExceptionOperation(failure)))
            {
                MailboxReplicationServiceFault.Throw(failure);
            }
        }
Ejemplo n.º 7
0
 private void ExecuteAsyncRequest(HttpWebRequest request)
 {
     try
     {
         ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "[PreloadSessionDataRequestCreator::ExecuteAsyncRequest]: Executing preload request");
         LiveIdAuthenticationCounters.TotalSessionDataPreloadRequestsSent.Increment();
         using (request.GetResponse())
         {
         }
     }
     catch (Exception ex)
     {
         if (!(ex is HttpException) && !(ex is WebException))
         {
             ExWatson.SendReport(ex, ReportOptions.DoNotFreezeThreads, null);
         }
         LiveIdAuthenticationCounters.TotalSessionDataPreloadRequestsFailed.Increment();
         ExTraceGlobals.CoreTracer.TraceError <Exception>(0L, "[PreloadSessionDataRequestCreator::ExecuteAsyncRequest]: General exception {0}.", ex);
     }
     finally
     {
         try
         {
             request.Abort();
         }
         catch
         {
         }
     }
 }
Ejemplo n.º 8
0
 public override byte[] Notify(int version, int type, byte[] inputParameterBytes)
 {
     byte[] result2;
     try
     {
         using (new Timer(new TimerCallback(RpcServerWrapper.CrashOnCallTimeout), Thread.CurrentThread, RpcServerWrapper.notifyRequestTimeout, TimeSpan.FromMilliseconds(-1.0)))
         {
             WorkItemBase           workItem = WorkItemBase.Deserialize(inputParameterBytes);
             SyncNotificationResult result   = null;
             try
             {
                 WorkItemBase workItem2 = SyncManager.EnqueueWorkItem(workItem);
                 result = new SyncNotificationResult(UnifiedPolicyNotificationFactory.Create(workItem2, new ADObjectId()));
             }
             catch (SyncAgentExceptionBase error)
             {
                 result = new SyncNotificationResult(error);
             }
             NotificationRpcOutParameters notificationRpcOutParameters = new NotificationRpcOutParameters(result);
             result2 = notificationRpcOutParameters.Serialize();
         }
     }
     catch (Exception ex)
     {
         ExWatson.SendReport(ex, ReportOptions.None, null);
         NotificationRpcOutParameters notificationRpcOutParameters = new NotificationRpcOutParameters(new SyncNotificationResult(ex));
         result2 = notificationRpcOutParameters.Serialize();
     }
     return(result2);
 }
        private void GetMailTipsWorker(object state)
        {
            MailTipsState mailTipsState = null;

            try
            {
                mailTipsState = (MailTipsState)state;
                ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "MailTipsNotificationHandler.GetMailTipsWorker");
                this.GetMailTipsInBatches(mailTipsState);
                this.mailTipsNotifier.AddToPayload(mailTipsState);
                this.mailTipsNotifier.PickupData();
            }
            catch (Exception ex)
            {
                ExTraceGlobals.CoreTracer.TraceError <Exception>((long)this.GetHashCode(), "Generic exception caught during GetMailTipsWorker call: {0}", ex);
                if (Globals.SendWatsonReports)
                {
                    ExTraceGlobals.CoreTracer.TraceError((long)this.GetHashCode(), "Sending watson report.");
                    ExWatson.AddExtraData(this.GetExtraWatsonData(mailTipsState));
                    ExWatson.SendReport(ex, ReportOptions.None, null);
                }
            }
            finally
            {
                Interlocked.Decrement(ref this.concurrentRequestCount);
                ExTraceGlobals.CoreCallTracer.TraceError <string, int>((long)this.GetHashCode(), "MailTipsNotificationHandler.GetMailTipsWorker, {0} concurrent requests count decremented to {1}", this.primarySmtpAddress, this.concurrentRequestCount);
            }
        }
 // Token: 0x0600016E RID: 366 RVA: 0x00009AC4 File Offset: 0x00007CC4
 internal void Start(MailboxSession mailboxSession)
 {
     if (DiscoveryHoldSynchronizer.IsOnPremDiscoveryArbitrationMailbox(mailboxSession))
     {
         if (this.cancellationTokenSource == null)
         {
             this.cancellationTokenSource = new CancellationTokenSource();
         }
         if (this.synchronizeTask != null && this.synchronizeTask.IsCompleted)
         {
             this.synchronizeTask.Dispose();
             this.synchronizeTask = null;
         }
         if (this.synchronizeTask == null)
         {
             this.synchronizeTask = new Task(new Action <object>(this.Synchronize), mailboxSession.MailboxOwner.ObjectId.ObjectGuid, this.cancellationTokenSource.Token);
             this.synchronizeTask.ContinueWith(delegate(Task task)
             {
                 if (task.IsFaulted && task.Exception != null && task.Exception.InnerException != null)
                 {
                     if (!(task.Exception.InnerException is LocalizedException) && GrayException.IsGrayException(task.Exception.InnerException))
                     {
                         ExWatson.SendReport(task.Exception.InnerException, ReportOptions.None, null);
                     }
                     SearchEventLogger.Instance.LogFailedToSyncDiscoveryHoldToExchangeOnlineEvent(task.Exception.InnerException);
                 }
             }, this.cancellationTokenSource.Token);
             this.synchronizeTask.Start();
         }
     }
 }
Ejemplo n.º 11
0
        public void DisposePendingNotificationClientRequest()
        {
            if (base.OwaContext.UserContext == null)
            {
                return;
            }
            this.pendingManager = base.OwaContext.UserContext.PendingRequestManager;
            object parameter = base.GetParameter("Fn");

            if (parameter != null)
            {
                bool flag = (bool)parameter;
            }
            int num = 0;

            try
            {
                base.UserContext.DangerousBeginUnlockedAction(false, out num);
                if (num != 1)
                {
                    ExWatson.SendReport(new InvalidOperationException("Thread held more than 1 lock in DisposePendingNotificationClientRequest method."), ReportOptions.None, null);
                }
                bool         flag2        = this.pendingManager.HandleFinishRequestFromClient();
                HttpResponse httpResponse = base.OwaContext.HttpContext.Response;
                httpResponse.Write("var syncFnshRq = ");
                httpResponse.Write(flag2 ? "1" : "0");
                httpResponse.AppendHeader("X-OWA-EventResult", "0");
                Utilities.MakePageNoCacheNoStore(httpResponse);
                httpResponse.ContentType = Utilities.GetContentTypeString(base.ResponseContentType);
            }
            finally
            {
                base.UserContext.DangerousEndUnlockedAction(false, num);
            }
        }
 internal void Process(HttpContext context)
 {
     ExTraceGlobals.WebHealthTracer.TraceDebug((long)this.GetHashCode(), "ExWebTimeoutReportHandler::ProcessHealth()");
     try
     {
         if (ExMonitoringRequestTracker.Instance.IsKnownMonitoringRequest(context.Request))
         {
             context.Response.StatusCode = 200;
         }
         else
         {
             context.Response.StatusCode = 403;
         }
     }
     catch (Exception ex)
     {
         Exception ex2;
         Exception ex = ex2;
         ExTraceGlobals.WebHealthTracer.TraceError <Exception>((long)this.GetHashCode(), "ExWebTimeoutReportHandler::Process encountered error {0}", ex);
         ThreadPool.QueueUserWorkItem(delegate(object o)
         {
             ExWatson.SendReport(ex, ReportOptions.DoNotCollectDumps | ReportOptions.DoNotFreezeThreads, string.Empty);
         });
     }
 }
Ejemplo n.º 13
0
 internal static void UserContextRemovedCallback(string key, object value, CacheItemRemovedReason reason)
 {
     try
     {
     }
     finally
     {
         try
         {
             UserContextManager.UserContextCacheWrapper userContextCacheWrapper = value as UserContextManager.UserContextCacheWrapper;
             if (userContextCacheWrapper.UserContext != null)
             {
                 ExTraceGlobals.UserContextTracer.TraceDebug <string, UserContext, int>(0L, "Removing user context from cache, Key={0}, User context instance={1}, Reason={2}", key, userContextCacheWrapper.UserContext, (int)reason);
                 UserContextManager.TerminateSession(userContextCacheWrapper.UserContext, reason);
             }
         }
         catch (ThreadAbortException)
         {
         }
         catch (Exception exception)
         {
             if (Globals.SendWatsonReports)
             {
                 ExTraceGlobals.CoreTracer.TraceDebug(0L, "Sending watson report");
                 ExWatson.SendReport(exception, ReportOptions.None, null);
             }
         }
     }
 }
Ejemplo n.º 14
0
        // Token: 0x0600031F RID: 799 RVA: 0x0000D79C File Offset: 0x0000B99C
        public static void AssertOrWatson(bool condition, string formatString, params object[] parameters)
        {
            if (condition)
            {
                return;
            }
            StringBuilder stringBuilder = new StringBuilder("ASSERT_WATSON: ");

            if (formatString != null)
            {
                if (parameters != null)
                {
                    stringBuilder.AppendFormat(CultureInfo.InvariantCulture, formatString, parameters);
                }
                else
                {
                    stringBuilder.Append(formatString);
                }
            }
            string text = stringBuilder.ToString();

            ExTraceGlobals.ReplayApiTracer.TraceError <string>(0L, "AssertOrWatson: Sending Watson report. {0}", text);
            Exception exception = null;

            try
            {
                throw new ExAssertException(text);
            }
            catch (ExAssertException ex)
            {
                exception = ex;
            }
            ExWatson.SendReport(exception, ReportOptions.None, "AssertOrWatson");
        }
Ejemplo n.º 15
0
 internal static void SendInstantMessageWatsonReport(IUserContext userContext, Exception exception)
 {
     Microsoft.Exchange.Clients.Owa.Server.LyncIMLogging.ExTraceGlobals.InstantMessagingTracer.TraceDebug(0L, "Exception: Type: {0} Error: {1}.", new object[]
     {
         exception.GetType(),
         exception.Message
     });
     if (Globals.SendWatsonReports)
     {
         Microsoft.Exchange.Clients.Owa.Server.LyncIMLogging.ExTraceGlobals.InstantMessagingTracer.TraceDebug(0L, "Sending watson report");
         ReportOptions options = (exception is AccessViolationException || exception is InvalidProgramException || exception is TypeInitializationException) ? ReportOptions.ReportTerminateAfterSend : ReportOptions.None;
         ExWatson.AddExtraData(InstantMessageUtilities.GetExtraWatsonData(userContext));
         ExWatson.SendReport(exception, options, null);
     }
     if (exception is AccessViolationException)
     {
         Microsoft.Exchange.Clients.Owa.Server.LyncIMLogging.ExTraceGlobals.InstantMessagingTracer.TraceDebug(0L, "Shutting down OWA due to unrecoverable exception");
         ErrorHandlerUtilities.TerminateProcess();
         return;
     }
     if ((exception is InvalidProgramException || exception is TypeInitializationException) && Interlocked.Exchange(ref InstantMessageUtilities.queuedDelayedRestart, 1) == 0)
     {
         new Thread(new ThreadStart(InstantMessageUtilities.DelayedRestartUponUnexecutableCode)).Start();
     }
 }
Ejemplo n.º 16
0
        public static void FailFast(string message, bool alwaysTerminate)
        {
            bool flag = ExDiagnostics.FailFastMode != FailFastMode.Exception && ExDiagnostics.FailFastMode != FailFastMode.Test;

            flag = (flag || alwaysTerminate);
            try
            {
                ExDiagnostics.failFastEventHandlers(flag);
            }
            catch
            {
            }
            if (ExDiagnostics.FailFastMode == FailFastMode.Test && !flag)
            {
                throw new TestFailFastException(message);
            }
            FailFastException ex = new FailFastException(message, new StackTrace(1, true).ToString());

            ExWatson.SendReport(ex);
            if (flag)
            {
                Environment.Exit(1);
                return;
            }
            throw ex;
        }
 // Token: 0x0600768B RID: 30347 RVA: 0x0018667C File Offset: 0x0018487C
 private void HandleTimeoutCacheWorkerException(Exception unhandledException)
 {
     ExTraceGlobals.ResourceHealthManagerTracer.TraceError <Exception>((long)this.GetHashCode(), "[ResourceHealthMonitorManager.HandleTimeoutCacheWorkerException] Encountered exception on timeout cache worker thread.  Exception: {0}", unhandledException);
     if (!(unhandledException is ThreadAbortException) && !(unhandledException is AppDomainUnloadedException))
     {
         ExWatson.SendReport(unhandledException);
     }
 }
Ejemplo n.º 18
0
 internal static void FriendlyWatson(Exception exception)
 {
     if (Debugger.IsAttached)
     {
         Debugger.Break();
     }
     ExWatson.SendReport(exception, ReportOptions.DeepStackTraceHash, null);
 }
Ejemplo n.º 19
0
 private static void ReportWatson(Exception e)
 {
     if (!ExWatson.IsWatsonReportAlreadySent(e))
     {
         ExWatson.SendReport(e, ReportOptions.None, null);
         ExWatson.SetWatsonReportAlreadySent(e);
     }
 }
 private void EnforceInternalState(ContactsUploaderPerformanceTracker.InternalState expectedState, string action)
 {
     if (this.internalState != expectedState)
     {
         string message = string.Format("{0} can only be performed when state is {1}. Present state is {2}", action, expectedState, this.internalState);
         ExWatson.SendReport(new InvalidOperationException(message), ReportOptions.None, null);
     }
 }
        // Token: 0x0600105C RID: 4188 RVA: 0x0003EDF8 File Offset: 0x0003CFF8
        private bool TryParseUserContextKey(string contextKey, out UserContextKey contextKeyObj)
        {
            bool flag = UserContextKey.TryParse(contextKey, out contextKeyObj);

            if (!flag)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)this.GetHashCode(), "RemoteNotificationManager.TryParseUserContextKey - couldn't parse UserContextKey {0}, skipping cleanup", contextKey);
                ExWatson.SendReport(new ArgumentException(string.Format("RemoteNotificationManager::TryParseUserContextKey - TryParse failed for UserContextKey string - '{0}'", contextKey)), ReportOptions.None, null);
            }
            return(flag);
        }
Ejemplo n.º 22
0
 private void LogInputData()
 {
     try
     {
         this.UpdateCustomLoggingData();
     }
     catch (Exception exception)
     {
         ExWatson.SendReport(exception, ReportOptions.DoNotCollectDumps | ReportOptions.DoNotLogProcessAndThreadIds | ReportOptions.DoNotFreezeThreads, string.Empty);
     }
 }
 // Token: 0x06000E4B RID: 3659 RVA: 0x00055CE4 File Offset: 0x00053EE4
 private static void SubmitInformationalWatson(IExchangePrincipal exchangePrincipal, TimeSpan retryTimeSpan)
 {
     try
     {
         string message = string.Format("Sharing Policy Assistant could not process mailbox for {0} even after:{1} hours. Threshold:{2} hours", exchangePrincipal.MailboxInfo.PrimarySmtpAddress, retryTimeSpan.TotalHours, SharingPolicyAssistant.RetryThresholdLimit.TotalHours);
         throw new InvalidOperationException(message);
     }
     catch (InvalidOperationException exception)
     {
         ExWatson.SendReport(exception, ReportOptions.DoNotCollectDumps | ReportOptions.DeepStackTraceHash | ReportOptions.DoNotFreezeThreads, string.Empty);
     }
 }
Ejemplo n.º 24
0
 private void SendWatsonReport <TException>(TException exception) where TException : Exception
 {
     try
     {
         throw exception;
     }
     catch (TException ex)
     {
         TException ex2 = (TException)((object)ex);
         ExWatson.SendReport(ex2, ReportOptions.None, ex2.Message);
     }
 }
Ejemplo n.º 25
0
        internal void ProcessHealth(IExWebHealthResponseWrapper response)
        {
            ExTraceGlobals.WebHealthTracer.TraceDebug((long)this.GetHashCode(), "ExWebHealthHandler::ProcessHealth()");
            string value = "Passed";

            response.AddHeader("X-MSExchApplicationHealthHandler", this.appName);
            Func <ExWebHealthHandler.CustomHealthCheckResult> customHealthCallback = this.CustomHealthCallback;

            if (customHealthCallback != null)
            {
                ExTraceGlobals.WebHealthTracer.TraceDebug((long)this.GetHashCode(), "ExWebHealthHandler::ProcessHealth calling custom health check callback ");
                try
                {
                    ExWebHealthHandler.CustomHealthCheckResult customHealthCheckResult = customHealthCallback();
                    ExTraceGlobals.WebHealthTracer.TraceDebug <ExWebHealthHandler.CustomHealthCheckResult>((long)this.GetHashCode(), "ExWebHealthHandler::ProcessHealth Custom health check status = {0}", customHealthCheckResult);
                    if (customHealthCheckResult == ExWebHealthHandler.CustomHealthCheckResult.Healthy)
                    {
                        value = "Passed";
                    }
                    else if (customHealthCheckResult == ExWebHealthHandler.CustomHealthCheckResult.NotHealthy)
                    {
                        value = "Failed";
                    }
                    else
                    {
                        value = "NonDeterministic";
                    }
                }
                catch (Exception ex)
                {
                    Exception ex2;
                    Exception ex = ex2;
                    ExTraceGlobals.WebHealthTracer.TraceError <Exception>((long)this.GetHashCode(), "ExWebHealthHandler::ProcessHealth Callback encountered error {0}", ex);
                    if (ex is OutOfMemoryException)
                    {
                        value = "Failed";
                    }
                    else
                    {
                        value = "NonDeterministic";
                        if (this.ShouldSubmitWatson(ex))
                        {
                            ThreadPool.QueueUserWorkItem(delegate(object o)
                            {
                                ExWatson.SendReport(ex, ReportOptions.DoNotCollectDumps, string.Empty);
                            });
                        }
                    }
                }
            }
            response.AddHeader("X-MSExchApplicationHealthHandlerStatus", value);
            response.StatusCode = 200;
        }
Ejemplo n.º 26
0
 internal static void FriendlyWatson(Exception exception)
 {
     if (Debugger.IsAttached)
     {
         Debugger.Break();
     }
     ActivityContext.RaiseEvent(ActivityContext.GetCurrentActivityScope(), new ActivityEventArgs(ActivityEventType.WatsonActivity, exception.Message));
     if (!ActivityContext.DisableFriendlyWatsonForTesting)
     {
         ExWatson.SendReport(exception, ReportOptions.DoNotCollectDumps | ReportOptions.DeepStackTraceHash, null);
     }
 }
        private MailboxSession CreateMailboxSession(IExchangePrincipal principal)
        {
            if (principal.MailboxInfo.IsArchive && !principal.IsCrossSiteAccessAllowed)
            {
                StackTrace stackTrace = new StackTrace();
                Exception  exception  = new OwaInvalidOperationException(string.Format("Archive Sessions should be allowed cross site, stack trace {0}", stackTrace.ToString()));
                ExWatson.SendReport(exception, ReportOptions.None, null);
            }
            MailboxSession mailboxSession = this.userContext.LogonIdentity.CreateMailboxSession(principal, Thread.CurrentThread.CurrentCulture, HttpContext.Current.Request);

            mailboxSession.ExTimeZone = this.userContext.MailboxSession.ExTimeZone;
            return(mailboxSession);
        }
Ejemplo n.º 28
0
 private void BeginInvokeInternal(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     try
     {
         GrayException.MapAndReportGrayExceptions(delegate()
         {
             try
             {
                 this.asyncResult = this.BeginInvoke();
             }
             catch (SoapException exception)
             {
                 this.HandleException(exception);
             }
             catch (UriFormatException exception2)
             {
                 this.HandleException(exception2);
             }
             catch (WebException exception3)
             {
                 this.HandleException(exception3);
             }
             catch (IOException ex2)
             {
                 SocketException ex3 = ex2.InnerException as SocketException;
                 if (ex3 == null)
                 {
                     ExWatson.SendReport(ex2, ReportOptions.None, null);
                     this.HandleException(ex2);
                 }
                 else
                 {
                     this.HandleException(ex3);
                 }
             }
             catch (LocalizedException exception4)
             {
                 this.HandleException(exception4);
             }
         });
     }
     catch (GrayException ex)
     {
         this.HandleException(ex.InnerException);
     }
     if (this.asyncResult == null && this.CompleteAtomically())
     {
         this.Complete();
     }
 }
 // Token: 0x06000961 RID: 2401 RVA: 0x0003F4C0 File Offset: 0x0003D6C0
 public static bool TryHandleException(long id, string action, string source, Exception ex)
 {
     ExTraceGlobals.AssistantTracer.TraceError <string, string, Exception>(id, "Exception is caught during {0} for {1}: {2}", action, source, ex);
     if (ex is StorageTransientException || ex is StoragePermanentException || ex is AITransientException || ex is MissingSystemMailboxException || ex is LocalServerException || ex is DataValidationException || ex is DataSourceTransientException || ex is DataSourceOperationException)
     {
         return(true);
     }
     if (GrayException.IsGrayException(ex))
     {
         ExWatson.SendReport(ex, ReportOptions.None, null);
         return(true);
     }
     return(false);
 }
        // Token: 0x060000F9 RID: 249 RVA: 0x00008004 File Offset: 0x00006204
        public static void SendWatson(Exception exception)
        {
            bool flag = true;

            if (!bool.TryParse(ConfigurationManager.AppSettings["SendWatsonReport"], out flag))
            {
                flag = true;
            }
            if (flag)
            {
                ExTraceGlobals.CoreTracer.TraceDebug(0L, "Sending Watson report");
                ExWatson.SendReport(exception, ReportOptions.None, null);
            }
        }