Exemplo n.º 1
0
 private static void ReportWatson(Exception e)
 {
     if (!ExWatson.IsWatsonReportAlreadySent(e))
     {
         ExWatson.SendReport(e, ReportOptions.None, null);
         ExWatson.SetWatsonReportAlreadySent(e);
     }
 }
Exemplo n.º 2
0
        private static bool IsSendReportValid(Exception exception)
        {
            if (ExWatson.IsWatsonReportAlreadySent(exception))
            {
                return(false);
            }
            bool flag = Diagnostics.SendWatsonReports.Value;

            if (flag && Diagnostics.FilterExceptionsFromWatsonReport.Value)
            {
                if (exception is HttpException)
                {
                    flag = false;
                }
                else if (exception is System.ServiceModel.QuotaExceededException)
                {
                    flag = false;
                }
                else if (exception is DataValidationException)
                {
                    flag = false;
                }
                else if (exception is DataSourceOperationException)
                {
                    flag = false;
                }
                else if (exception is StoragePermanentException || exception is StorageTransientException)
                {
                    flag = false;
                }
                else if (exception is ServiceDiscoveryTransientException)
                {
                    flag = false;
                }
                else if (exception is IOException)
                {
                    flag = false;
                }
                else if (exception is OutOfMemoryException)
                {
                    flag = false;
                }
                else if (exception is ADTransientException)
                {
                    flag = false;
                }
                else if (exception is ThreadAbortException)
                {
                    flag = false;
                }
                else if (exception.StackTrace.Contains("Microsoft.Exchange.Diagnostics.FaultInjection.FaultInjectionTrace.InjectException"))
                {
                    flag = false;
                }
            }
            ExTraceGlobals.ExceptionTracer.TraceDebug <bool>(0L, "IsSendReportValid isSendReportValid: {0}", flag);
            return(flag);
        }
Exemplo n.º 3
0
        private static bool IsSendReportValid(Exception exception, ExWatson.IsExceptionInteresting isExceptionInteresting)
        {
            if (ExWatson.IsWatsonReportAlreadySent(exception))
            {
                return(false);
            }
            bool flag = isExceptionInteresting == null || isExceptionInteresting(exception);

            ExTraceGlobals.InstrumentationTracer.TraceDebug <bool>(0L, "IsSendReportValid isSendReportValid: {0}", flag);
            return(flag);
        }
Exemplo n.º 4
0
        // Token: 0x0600008C RID: 140 RVA: 0x0000482C File Offset: 0x00002A2C
        internal static void ReportException(Exception exception, object responsibleObject, HttpContext httpContext)
        {
            if (!Common.IsSendReportValid(exception))
            {
                return;
            }
            if (ExWatson.IsWatsonReportAlreadySent(exception))
            {
                return;
            }
            ExTraceGlobals.FrameworkTracer.TraceDebug <Type>((long)responsibleObject.GetHashCode(), "[ReportException()] exception.GetType()=\"{0}\"", exception.GetType());
            bool flag = exception is AccessViolationException;

            if (Common.EventLog != null && exception != null && exception.Message.Length != 0)
            {
                ExTraceGlobals.FrameworkTracer.TraceError <Exception>((long)responsibleObject.GetHashCode(), "[ReportException()] exception=\"{0}\"", exception);
                Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_ErrWebException, Common.PeriodicKey, new object[]
                {
                    exception.Message,
                    exception.StackTrace
                });
                string text;
                string text2;
                string text3;
                if (httpContext != null && httpContext.Request != null && httpContext.User != null && httpContext.User.Identity.IsAuthenticated)
                {
                    text  = httpContext.User.Identity.GetSecurityIdentifier().Value;
                    text2 = (httpContext.Request.UserHostAddress ?? string.Empty);
                    text3 = (httpContext.Request.UserHostName ?? string.Empty);
                }
                else
                {
                    text  = string.Empty;
                    text2 = string.Empty;
                    text3 = string.Empty;
                }
                ExTraceGlobals.FrameworkTracer.TraceDebug <string, string, string>((long)responsibleObject.GetHashCode(), "[ReportException()] userSid=\"{0}\";userHostAddress=\"{1}\";userHostName=\"{2}\"", text, text2, text3);
                Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_InfoWebSessionFailure, Common.PeriodicKey, new object[]
                {
                    text,
                    text2,
                    text3
                });
            }
            ExWatson.HandleException(new UnhandledExceptionEventArgs(exception, flag), ReportOptions.None);
            ExWatson.SetWatsonReportAlreadySent(exception);
            if (flag)
            {
                ExTraceGlobals.FrameworkTracer.TraceError(0L, "[ReportException()] 'Terminating the process'");
                Environment.Exit(1);
            }
        }