示例#1
0
        public static void SendGrayExceptionWatsonReport(string exceptionDetails)
        {
            StackTrace   stackTrace = new StackTrace(1);
            MethodBase   method     = stackTrace.GetFrame(0).GetMethod();
            AssemblyName name       = method.DeclaringType.Assembly.GetName();
            int          hashCode   = (method.Name + "Unexpected GrayException").GetHashCode();

            ExWatson.SendGenericWatsonReport("E12", Util.AppVersion, ExWatson.AppName, name.Version.ToString(), name.Name, "Unexpected GrayException", stackTrace.ToString(), hashCode.ToString("x"), method.Name, exceptionDetails);
        }
        // Token: 0x06000595 RID: 1429 RVA: 0x0001B694 File Offset: 0x00019894
        protected override void OnHangDetected(int hangsDetected)
        {
            if (hangsDetected == 0)
            {
                try
                {
                    base.MonitoredThread.Suspend();
                    try
                    {
                        this.CallStack = new StackTrace(base.MonitoredThread, true).ToString();
                    }
                    finally
                    {
                        base.MonitoredThread.Resume();
                    }
                }
                catch
                {
                    this.CallStack = "Unknown";
                }
                SingletonEventLogger.Logger.LogEvent(AssistantsEventLogConstants.Tuple_ShutdownAssistantsThreadHanging, null, new object[]
                {
                    base.DatabaseName,
                    base.AssistantName,
                    base.InvokeTime.ToLocalTime(),
                    this.CallStack
                });
                return;
            }
            SingletonEventLogger.Logger.LogEvent(AssistantsEventLogConstants.Tuple_ShutdownAssistantsThreadHangPersisted, null, new object[]
            {
                base.DatabaseName,
                base.AssistantName,
                base.InvokeTime.ToLocalTime(),
                this.CallStack
            });
            string       text       = string.Format("Hung detected for assistant {0} on database {1}. Shutting down service by calling Process.Kill.", base.AssistantName, base.DatabaseName);
            StackTrace   stackTrace = new StackTrace(1);
            MethodBase   method     = stackTrace.GetFrame(0).GetMethod();
            AssemblyName name       = method.DeclaringType.Assembly.GetName();
            int          hashCode   = (method.Name + text + base.AssistantName).GetHashCode();

            Thread.Sleep(TimeSpan.FromSeconds(10.0));
            ExWatson.SendGenericWatsonReport("E12", ExWatson.RealApplicationVersion.ToString(), ExWatson.RealAppName, name.Version.ToString(), name.Name, text, this.CallStack, hashCode.ToString("x"), method.Name, this.GetCrashingMessage());
            Process.GetCurrentProcess().Kill();
        }
 // Token: 0x06000006 RID: 6 RVA: 0x0000244C File Offset: 0x0000064C
 protected override bool Initialize()
 {
     try
     {
         Kerberos.FlushTicketCache();
     }
     catch (Win32Exception ex)
     {
         if (ex.ErrorCode == -2146232828)
         {
             return(false);
         }
         string text = string.Format("{0}{1}NativeErrorCode = {2}", ex.ToString(), Environment.NewLine, ex.NativeErrorCode);
         ExTraceGlobals.ServiceTracer.TraceError <string>(0L, "TransportService failed to flush Kerberos ticket cache on Initialize because {0}", text);
         TransportService.logger.LogEvent(TransportEventLogConstants.Tuple_FailedToFlushTicketCacheOnInitialize, null, new object[]
         {
             text
         });
         ExWatson.SendGenericWatsonReport("E12", ExWatson.ApplicationVersion.ToString(), ExWatson.AppName, "15.00.1497.010", Assembly.GetExecutingAssembly().GetName().Name, ex.GetType().Name, ex.StackTrace, ex.GetHashCode().ToString(), ex.TargetSite.Name, text);
         return(false);
     }
     return(base.Initialize());
 }
 public static void SendInformationalWatson(Exception exception, string detailedExceptionInformation)
 {
     ArgumentValidator.ThrowIfNull("exception", exception);
     ArgumentValidator.ThrowIfNullOrEmpty("detailedExceptionInformation", detailedExceptionInformation);
     ExWatson.SendGenericWatsonReport("E12", ExWatson.ApplicationVersion.ToString(), ExWatson.AppName, "15.00.1497.012", Assembly.GetExecutingAssembly().GetName().Name, exception.GetType().Name, exception.StackTrace, exception.GetHashCode().ToString(), exception.TargetSite.Name, detailedExceptionInformation);
 }