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);
            }
        }
Exemplo n.º 2
0
 internal override object this[PropertyDefinition propertyDefinition]
 {
     get
     {
         object result;
         try
         {
             result = base[propertyDefinition];
         }
         catch (ArgumentException)
         {
             ExWatson.AddExtraData(string.Format("\r\nthis.Identity = {0}\r\nthis.ObjectState = {1}\r\nthis.IsReadOnly = {2}\r\nthis.session = {3}\r\nthis.session.ReadOnly = {4}\r\nthis.propertyBag.Keys.Count = {5}\r\nthis.ObjectSchema.AllProperties.Count = {6}\r\n", new object[]
             {
                 this.Identity,
                 base.ObjectState,
                 base.IsReadOnly,
                 (this.m_Session == null) ? "<null>" : this.m_Session.ToString(),
                 (this.m_Session == null) ? "<null>" : this.m_Session.ReadOnly.ToString(),
                 this.propertyBag.Keys.Count,
                 this.Schema.AllProperties.Count
             }));
             ExWatson.AddExtraData("this.propertyBag.Keys = " + ADObject.CollectionToString(this.propertyBag.Keys));
             ExWatson.AddExtraData("this.Schema.AllProperties = " + ADObject.CollectionToString(this.Schema.AllProperties));
             throw;
         }
         return(result);
     }
     set
     {
         base[propertyDefinition] = value;
     }
 }
Exemplo n.º 3
0
 public static object GetSerializationData(PSObject psObject)
 {
     ExTraceGlobals.SerializationTracer.TraceFunction <PSObject>(0L, "SerializationTypeConvertor.GetSerializationData({0})", psObject);
     byte[] result = null;
     try
     {
         using (MemoryStream memoryStream = new MemoryStream())
         {
             BinaryFormatter binaryFormatter = ExchangeBinaryFormatterFactory.CreateBinaryFormatter(null);
             binaryFormatter.Serialize(memoryStream, psObject.BaseObject);
             result = memoryStream.ToArray();
         }
     }
     catch (Exception arg)
     {
         ExTraceGlobals.SerializationTracer.TraceDebug <Exception>(0L, "Serialization Failed. Error = {0}", arg);
         if (psObject != null && psObject.BaseObject != null)
         {
             ExWatson.AddExtraData("Object Type: " + psObject.BaseObject.GetType().ToString());
             ExWatson.AddExtraData("Object String: " + psObject.BaseObject.ToString());
             ExWatson.AddExtraData("Handler StackTrace: " + Environment.StackTrace);
         }
         throw;
     }
     return(result);
 }
Exemplo n.º 4
0
 // Token: 0x06000009 RID: 9 RVA: 0x000026C8 File Offset: 0x000008C8
 private static void LogStage(MailboxTransportDeliveryService.Stage stage)
 {
     MailboxTransportDeliveryService.stage      = stage;
     MailboxTransportDeliveryService.logData[0] = new KeyValuePair <string, object>("Stage", stage.ToString());
     CommonDiagnosticsLog.Instance.LogEvent(CommonDiagnosticsLog.Source.MailboxDeliveryService, MailboxTransportDeliveryService.logData);
     ExWatson.AddExtraData(string.Format("{0:u}: Stage={1}", DateTime.UtcNow, stage));
 }
Exemplo n.º 5
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();
     }
 }
 // Token: 0x06000016 RID: 22 RVA: 0x0000273C File Offset: 0x0000093C
 private static void LogStage(MailboxTransportSubmissionService.Stage stage)
 {
     MailboxTransportSubmissionService.stage = stage;
     MailboxTransportSubmissionService.stageTimes.Add(new KeyValuePair <string, string>(stage.ToString(), DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)));
     KeyValuePair <string, object>[] eventData = new KeyValuePair <string, object>[]
     {
         new KeyValuePair <string, object>("Stage", stage.ToString())
     };
     CommonDiagnosticsLog.Instance.LogEvent(CommonDiagnosticsLog.Source.MailboxTransportSubmissionService, eventData);
     ExWatson.AddExtraData(string.Format("{0:u}: Stage={1}", DateTime.UtcNow, stage));
 }
        // Token: 0x06001471 RID: 5233 RVA: 0x0007CD6C File Offset: 0x0007AF6C
        private bool ProcessErrorNotification(QueryNotification notification)
        {
            bool flag = false;

            if (notification.ErrorCode != 0)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <int>((long)this.GetHashCode(), "Error in Notification: {0}", notification.ErrorCode);
                flag = true;
            }
            else if (notification.EventType == QueryNotificationType.Error)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "Error in Notification, Type is QueryNotificationType.Error");
                flag = true;
            }
            else if ((notification.EventType == QueryNotificationType.RowAdded || notification.EventType == QueryNotificationType.RowModified) && notification.Row.Length < this.subscriptionProperties.Length)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <int, int>((long)this.GetHashCode(), "XSO gave an incomplete notification, expected row length {0}, actual row length {1}", notification.Row.Length, this.subscriptionProperties.Length);
                flag = true;
            }
            try
            {
                TimeGroupByList2 timeGroupByList = this.listView as TimeGroupByList2;
                if (timeGroupByList != null && !timeGroupByList.IsValid())
                {
                    flag = true;
                    this.needReinitSubscriptions = true;
                }
            }
            catch (Exception ex)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Unexpected exception in FolderContentChangeNotificationHandler:ProcessErrorNotification. Exception: {0}", ex.ToString());
                if (Globals.SendWatsonReports)
                {
                    ExTraceGlobals.CoreTracer.TraceDebug(0L, "Sending watson report");
                    ExWatson.AddExtraData(this.GetExtraWatsonData());
                    ExWatson.SendReport(ex);
                }
                flag = true;
                this.needReinitSubscriptions = true;
            }
            if (flag)
            {
                this.AddFolderRefreshPayload();
                this.payload.PickupData();
                return(true);
            }
            return(false);
        }
Exemplo n.º 8
0
 public static void SendReportForCriticalException(HttpContext context, Exception exception)
 {
     if (exception.IsUICriticalException() && exception.IsControlPanelException())
     {
         ExWatson.AddExtraData(ErrorHandlingUtil.GetEcpWatsonExtraData(context, exception));
         EcpPerfCounters.SendWatson.Increment();
         RbacPrincipal rbacPrincipal = context.User as RbacPrincipal;
         if (rbacPrincipal != null && ExTraceConfiguration.Instance.InMemoryTracingEnabled)
         {
             TroubleshootingContext troubleshootingContext = rbacPrincipal.RbacConfiguration.TroubleshootingContext;
             troubleshootingContext.SendTroubleshootingReportWithTraces(exception, ErrorHandlingUtil.GetEcpWatsonTitle(exception, context));
             return;
         }
         ExWatson.SendReport(exception, ReportOptions.ReportTerminateAfterSend, exception.GetCustomMessage());
     }
 }
Exemplo n.º 9
0
        internal static void ReportUnhandledException(Exception exception, HttpContext httpContext)
        {
            Exception ex = exception;

            if (exception is DataServiceException && exception.InnerException != null)
            {
                ex = exception.InnerException;
            }
            if (HttpContext.Current != null && HttpContext.Current.Response != null)
            {
                HttpContext.Current.Response.AddHeader("X-RWS-Error", (ex != null) ? ex.GetType().ToString() : string.Empty);
            }
            bool   flag = !(exception is DataServiceException) || (exception is DataServiceException && ((DataServiceException)exception).ErrorCode.Equals(ReportingErrorCode.UnknownError.ToString(), StringComparison.InvariantCultureIgnoreCase));
            string text;
            int    num;

            if (flag)
            {
                text = string.Format("UnknownError&ExceptionType={0}&ExceptionMessage={1}", (ex != null) ? ex.GetType().ToString() : string.Empty, (ex != null) ? ex.Message : string.Empty);
                num  = 500;
            }
            else
            {
                text = ((DataServiceException)exception).ErrorCode;
                num  = ((DataServiceException)exception).StatusCode;
            }
            RwsPerfCounters.RequestErrors.Increment();
            string text2 = (httpContext != null && httpContext.Request != null) ? httpContext.Request.Url.ToString() : string.Empty;

            ReportingWebServiceEventLogConstants.Tuple_RequestFailed.LogPeriodicEvent(EventLogExtension.GetPeriodicKeyPerUser(), new object[]
            {
                EventLogExtension.GetUserNameToLog(),
                text2,
                num.ToString(),
                text,
                ex,
                (ActivityContext.ActivityId != null) ? ActivityContext.ActivityId.Value.ToString() : "NoActivityId"
            });
            if (ServiceDiagnostics.sendWatsonReportsEnabled && ServiceDiagnostics.IsRWSException(exception) && !(exception is DataServiceException))
            {
                RwsPerfCounters.SendWatson.Increment();
                ExWatson.AddExtraData(text2);
                ExWatson.SendReport(exception);
            }
        }
        public void PrereadMessages()
        {
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("fId");
            MailboxSession   mailboxSession   = owaStoreObjectId.GetSession(base.UserContext) as MailboxSession;

            OwaStoreObjectId[] array  = (OwaStoreObjectId[])base.GetParameter("Itms");
            StoreId[]          array2 = null;
            if (mailboxSession == null)
            {
                throw new OwaInvalidRequestException("Session type does not support preread.");
            }
            if (array.Length == 0)
            {
                throw new ArgumentNullException("itemIds cannot be empty");
            }
            try
            {
                if (this.IsConversationView)
                {
                    array2 = ConversationUtilities.GetPrereadItemIds(mailboxSession, array);
                }
                else
                {
                    array2 = new StoreId[array.Length];
                    for (int i = 0; i < array.Length; i++)
                    {
                        array2[i] = Utilities.TryGetStoreId(array[i]);
                    }
                }
            }
            catch (ArgumentNullException exception)
            {
                if (Globals.SendWatsonReports)
                {
                    ExWatson.AddExtraData(this.GetExtraWatsonData(array));
                    ExWatson.SendReport(exception, ReportOptions.None, null);
                    return;
                }
            }
            mailboxSession.PrereadMessages(array2);
        }
Exemplo n.º 11
0
        // Token: 0x060000F7 RID: 247 RVA: 0x00007404 File Offset: 0x00005604
        public LogSession CreateSession(string name, Version schemaVersion)
        {
            ExTraceGlobals.ServiceTracer.TraceDebug((long)this.GetHashCode(), "MsExchangeLogSearch LogSessionManager CreateSession");
            LogSession result;

            lock (this.sessionLock)
            {
                if (this.stopping)
                {
                    throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SESSION_CANCELED);
                }
                Log log;
                if (!this.logs.TryGetValue(name, out log))
                {
                    throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_LOG_UNKNOWN_LOG);
                }
                if (this.sessions.Count == 100)
                {
                    LogSearchException ex            = new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SERVER_TOO_BUSY);
                    StringBuilder      stringBuilder = new StringBuilder(5300);
                    foreach (KeyValuePair <Guid, LogSession> keyValuePair in this.sessions)
                    {
                        stringBuilder.Append(keyValuePair.Key.ToString("N"));
                        stringBuilder.Append(":");
                        stringBuilder.Append(keyValuePair.Value.LastActivity.ToString("y/M/d:H:m:s"));
                        stringBuilder.Append(",");
                    }
                    ExWatson.AddExtraData(stringBuilder.ToString());
                    DiagnosticWatson.SendWatsonWithoutCrash(ex, "MaxSessionExceeded", TimeSpan.FromDays(1.0));
                    throw ex;
                }
                LogSession logSession = new LogSession(Guid.NewGuid(), log, schemaVersion);
                this.sessions[logSession.Id] = logSession;
                result = logSession;
            }
            return(result);
        }
        // Token: 0x06001463 RID: 5219 RVA: 0x0007C7A0 File Offset: 0x0007A9A0
        internal void ProcessNotification(TextWriter writer, QueryNotification notification, out bool successfullyProcessed)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (notification == null)
            {
                throw new ArgumentNullException("notification");
            }
            successfullyProcessed = true;
            if (this.isDisposed || this.missedNotifications || this.needReinitSubscriptions)
            {
                string message = string.Format("Ignoring folder content change notification for user {0}, isDisposed:{1}, missedNotifications:{2}, needReinitSubscriptions:{3}", new object[]
                {
                    this.MailboxSessionDisplayName,
                    this.isDisposed,
                    this.missedNotifications,
                    this.needReinitSubscriptions
                });
                ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), message);
                return;
            }
            try
            {
                QueryNotificationType eventType = notification.EventType;
                Culture.InternalSetAsyncThreadCulture(this.userContext.UserCulture);
                switch (eventType)
                {
                case QueryNotificationType.RowAdded:
                    this.ProcessRowAddedNotification(writer, notification);
                    break;

                case QueryNotificationType.RowDeleted:
                    this.ProcessRowDeletedNotification(writer, notification);
                    break;

                case QueryNotificationType.RowModified:
                    this.ProcessRowModifiedNotification(writer, notification);
                    break;

                default:
                    throw new ArgumentException("Invalid queryNotificationType :" + eventType);
                }
            }
            catch (Exception ex)
            {
                if (!this.isDisposed && !this.missedNotifications && !this.needReinitSubscriptions)
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Unexpected exception in FolderContentChangeNotificationHandler:ProcessNotification. Exception: {0}", ex.Message);
                    if (Globals.SendWatsonReports)
                    {
                        ExTraceGlobals.CoreTracer.TraceDebug(0L, "Sending watson report");
                        ExWatson.AddExtraData(this.GetExtraWatsonData());
                        ExWatson.SendReport(ex, ReportOptions.None, null);
                    }
                    successfullyProcessed    = false;
                    this.missedNotifications = true;
                }
            }
        }
Exemplo n.º 13
0
        public static void SendWatsonReport(Exception e, string taskName, PropertyBag boundParameters)
        {
            TaskLogger.StopFileLogging();
            bool flag = true;

            try
            {
                string sourceFileName = Path.Combine(ConfigurationContext.Setup.SetupLoggingPath, ConfigurationContext.Setup.SetupLogFileName);
                string text           = Path.Combine(ConfigurationContext.Setup.SetupLoggingPath, ConfigurationContext.Setup.SetupLogFileNameForWatson);
                File.Copy(sourceFileName, text, true);
                int num = 0;
                while (!ExWatson.TryAddExtraFile(text) && num < 10)
                {
                    Thread.Sleep(100);
                    num++;
                }
            }
            catch (FileNotFoundException)
            {
            }
            catch (DirectoryNotFoundException)
            {
            }
            catch (IOException)
            {
                flag = false;
                if (TaskLogger.IsFileLoggingEnabled)
                {
                    TaskLogger.LogErrorString(Strings.ExchangeSetupCannotCopyWatson(ConfigurationContext.Setup.SetupLogFileName, ConfigurationContext.Setup.SetupLogFileNameForWatson));
                }
            }
            if (flag)
            {
                if (!string.IsNullOrEmpty(taskName))
                {
                    ExWatson.AddExtraData("Task Name: " + taskName);
                }
                if (boundParameters != null)
                {
                    StringBuilder stringBuilder = new StringBuilder("Parameters:\n");
                    foreach (object obj in boundParameters)
                    {
                        DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
                        if (dictionaryEntry.Value is IList)
                        {
                            stringBuilder.AppendLine(string.Format("{0}:{1}", dictionaryEntry.Key, MultiValuedPropertyBase.FormatMultiValuedProperty(dictionaryEntry.Value as IList)));
                        }
                        else
                        {
                            stringBuilder.AppendLine(string.Format("{0}:'{1}'", dictionaryEntry.Key, (dictionaryEntry.Value == null) ? "<null>" : dictionaryEntry.Value.ToString()));
                        }
                    }
                    ExWatson.AddExtraData(stringBuilder.ToString());
                }
                ExWatson.SendReport(e, ReportOptions.DoNotFreezeThreads, null);
            }
            try
            {
                TaskLogger.ResumeFileLogging();
            }
            catch (IOException)
            {
                if (TaskLogger.IsFileLoggingEnabled)
                {
                    TaskLogger.LogErrorString(Strings.ExchangeSetupCannotResumeLog(ConfigurationContext.Setup.SetupLogFileName));
                }
                throw;
            }
        }
Exemplo n.º 14
0
 private void AcquireUseLicenseAndUsageRightsCallback(IAsyncResult asyncResult)
 {
     if (asyncResult == null)
     {
         throw new ArgumentNullException("asyncResult");
     }
     if (asyncResult.AsyncState == null)
     {
         IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: asyncResult.AsyncState is null.");
         throw new InvalidOperationException("asyncResult.AsyncState must NOT be null.");
     }
     IrmLicensingManager.AsyncState asyncState = (IrmLicensingManager.AsyncState)asyncResult.AsyncState;
     try
     {
         IrmLicensingManager.Tracer.TraceDebug <OwaStoreObjectId>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: calling EndAcquireUseLicenseAndUsageRights to get results for message {0}", asyncState.MessageId);
         UseLicenseAndUsageRights useLicenseAndUsageRights = RmsClientManager.EndAcquireUseLicenseAndUsageRights(asyncResult);
         if (string.IsNullOrEmpty(useLicenseAndUsageRights.UseLicense))
         {
             IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: Use license is null/empty");
             throw new InvalidOperationException("Use license must NOT be null/empty");
         }
         if (this.userContext.State != UserContextState.Active)
         {
             IrmLicensingManager.Tracer.TraceDebug((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: User context is no longer active.  Bailing out.");
         }
         else
         {
             SafeRightsManagementHandle safeRightsManagementHandle = null;
             try
             {
                 RmsClientManager.BindUseLicenseForDecryption(new RmsClientManagerContext(useLicenseAndUsageRights.OrganizationId, RmsClientManagerContext.ContextId.MessageId, asyncState.MessageId.ToString(), null), useLicenseAndUsageRights.LicensingUri, useLicenseAndUsageRights.UseLicense, useLicenseAndUsageRights.PublishingLicense, out safeRightsManagementHandle);
             }
             finally
             {
                 if (safeRightsManagementHandle != null)
                 {
                     safeRightsManagementHandle.Close();
                 }
             }
             bool flag = false;
             try
             {
                 this.userContext.Lock();
                 flag = true;
                 using (Item item = Item.Bind(asyncState.MessageId.GetSession(this.userContext), asyncState.MessageId.StoreObjectId, ItemBindOption.None))
                 {
                     MessageItem messageItem = item as MessageItem;
                     if (messageItem == null)
                     {
                         IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: bound item is not a message.  Ignoring it.");
                     }
                     else
                     {
                         messageItem.OpenAsReadWrite();
                         messageItem[MessageItemSchema.DRMRights]     = useLicenseAndUsageRights.UsageRights;
                         messageItem[MessageItemSchema.DRMExpiryTime] = useLicenseAndUsageRights.ExpiryTime;
                         if (!DrmClientUtils.IsCachingOfLicenseDisabled(useLicenseAndUsageRights.UseLicense))
                         {
                             using (Stream stream = messageItem.OpenPropertyStream(MessageItemSchema.DRMServerLicenseCompressed, PropertyOpenMode.Create))
                             {
                                 DrmEmailCompression.CompressUseLicense(useLicenseAndUsageRights.UseLicense, stream);
                             }
                         }
                         messageItem[MessageItemSchema.DRMPropsSignature] = useLicenseAndUsageRights.DRMPropsSignature;
                         RightsManagedMessageItem rightsManagedMessageItem = messageItem as RightsManagedMessageItem;
                         if (rightsManagedMessageItem != null && rightsManagedMessageItem.IsRestricted && !rightsManagedMessageItem.TryDecode(Utilities.CreateOutboundConversionOptions(this.userContext), false).Failed)
                         {
                             bool flag2 = false;
                             foreach (AttachmentHandle attachmentHandle in rightsManagedMessageItem.ProtectedAttachmentCollection)
                             {
                                 if (!attachmentHandle.IsInline)
                                 {
                                     flag2 = true;
                                     break;
                                 }
                             }
                             messageItem[MessageItemSchema.AllAttachmentsHidden] = !flag2;
                             rightsManagedMessageItem.AbandonChangesOnProtectedData();
                         }
                         messageItem.Save(SaveMode.ResolveConflicts);
                         if (DrmClientUtils.IsCachingOfLicenseDisabled(useLicenseAndUsageRights.UseLicense))
                         {
                             this.EnqueueLicensingError(asyncState.MessageId, SanitizedHtmlString.FromStringId(-1616549110, this.userCulture), asyncState.RequestCorrelator);
                         }
                         else
                         {
                             this.EnqueueLicenseAcquired(asyncState.MessageId, asyncState.RequestCorrelator);
                         }
                     }
                 }
             }
             finally
             {
                 if (this.userContext.LockedByCurrentThread() && flag)
                 {
                     this.userContext.Unlock();
                 }
             }
         }
     }
     catch (OwaLockTimeoutException arg)
     {
         IrmLicensingManager.Tracer.TraceError <OwaLockTimeoutException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: timed-out at acquiring user context lock.  Exception: {0}", arg);
         this.EnqueueLicensingError(asyncState.MessageId, new SanitizedHtmlString(LocalizedStrings.GetNonEncoded(858913858)), asyncState.RequestCorrelator);
     }
     catch (ExchangeConfigurationException arg2)
     {
         IrmLicensingManager.Tracer.TraceError <ExchangeConfigurationException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception.  Exception: {0}", arg2);
         this.HandleExchangeConfigurationException(asyncState.MessageId, asyncState.RequestCorrelator);
     }
     catch (RightsManagementException ex)
     {
         IrmLicensingManager.Tracer.TraceError <RightsManagementException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception.  Exception: {0}", ex);
         this.HandleRightsManagementException(ex, asyncState.MessageId, asyncState.RequestCorrelator);
     }
     catch (StoragePermanentException ex2)
     {
         IrmLicensingManager.Tracer.TraceError <StoragePermanentException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception.  Exception: {0}", ex2);
         this.EnqueueLicensingError(asyncState.MessageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(994351595, this.userCulture), new object[]
         {
             ex2.Message
         }), asyncState.RequestCorrelator);
     }
     catch (TransientException arg3)
     {
         IrmLicensingManager.Tracer.TraceError <TransientException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception.  Exception: {0}", arg3);
         this.EnqueueLicensingError(asyncState.MessageId, new SanitizedHtmlString(LocalizedStrings.GetNonEncoded(858913858)), asyncState.RequestCorrelator);
     }
     catch (Exception ex3)
     {
         IrmLicensingManager.Tracer.TraceError <Exception>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception.  Exception: {0}", ex3);
         if (Globals.SendWatsonReports)
         {
             IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: sending watson report...");
             string data = string.Format("OWA version: {0}; Message Id: {1}", Globals.ApplicationVersion, asyncState.MessageId.ToBase64String());
             ExWatson.AddExtraData(data);
             ExWatson.SendReport(ex3, ReportOptions.None, null);
             IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: watson report has been sent.");
         }
     }
 }
 // Token: 0x06000007 RID: 7 RVA: 0x000025E1 File Offset: 0x000007E1
 protected override void OnCommandTimeout()
 {
     ExWatson.AddExtraData(AIBreadcrumbs.Instance.GenerateReport());
     base.OnCommandTimeout();
 }