DetachCrashReporting() 공개 정적인 메소드

Detaches Raygun from listening to unhandled exceptions and unobserved task exceptions.
public static DetachCrashReporting ( ) : void
리턴 void
예제 #1
0
 /// <summary>
 /// Causes Raygun to listen to and send all unhandled exceptions and unobserved task exceptions.
 /// </summary>
 /// <returns>The RaygunClient to chain other methods.</returns>
 public RaygunClient AttachCrashReporting()
 {
     RaygunClient.DetachCrashReporting();
     AppDomain.CurrentDomain.UnhandledException  += CurrentDomain_UnhandledException;
     TaskScheduler.UnobservedTaskException       += TaskScheduler_UnobservedTaskException;
     AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;
     return(this);
 }
예제 #2
0
        /// <summary>
        /// Causes Raygun to listen to and send all unhandled exceptions and unobserved task exceptions.
        /// </summary>
        /// <returns>The RaygunClient to chain other methods.</returns>
        public RaygunClient AttachCrashReporting()
        {
            RaygunLogger.Debug("Enabling Crash Reporting");

            RaygunClient.DetachCrashReporting();

            SetUnhandledExceptionHandlers();

            return(this);
        }
예제 #3
0
        /// <summary>
        /// Causes Raygun to listen to and send all unhandled exceptions and unobserved task exceptions.
        /// </summary>
        /// <param name="canReportNativeErrors">Whether or not to listen to and report native exceptions.</param>
        /// <returns>The RaygunClient to chain other methods.</returns>
        public RaygunClient AttachCrashReporting(bool reportNativeErrors)
        {
            Debug.WriteLine("Raygun: Initialising crash reporting");
            RaygunClient.DetachCrashReporting();

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;

            if (reportNativeErrors)
            {
                NativeClient = NativeRaygunClient.SharedInstanceWithApiKey(_apiKey);
            }

            return(this);
        }
예제 #4
0
        /// <summary>
        /// Causes Raygun to listen to and send all unhandled exceptions and unobserved task exceptions.
        /// </summary>
        /// <param name="canReportNativeErrors">Whether or not to listen to and report native exceptions.</param>
        /// <returns>The RaygunClient to chain other methods.</returns>
        public RaygunClient AttachCrashReporting(bool reportNativeErrors)
        {
            Debug.WriteLine("Raygun: Initialising crash reporting");
            RaygunClient.DetachCrashReporting();

            SetUnhandledExceptionHandlers();

            if (reportNativeErrors)
            {
                NativeClient = NativeRaygunClient.SharedInstanceWithApiKey(_apiKey);
            }

            SendAllStoredCrashReports();

            return(this);
        }
예제 #5
0
        /// <summary>
        /// Causes Raygun to listen to and send all unhandled exceptions and unobserved task exceptions.
        /// </summary>
        /// <param name="canReportNativeErrors">Whether or not to listen to and report native exceptions.</param>
        /// <param name="hijackNativeSignals">When true, this solves the issue where null reference exceptions inside try/catch blocks crash the app, but when false, additional native errors can be reported.</param>
        /// <returns>The RaygunClient to chain other methods.</returns>
        public RaygunClient AttachCrashReporting(bool canReportNativeErrors, bool hijackNativeSignals)
        {
            RaygunClient.DetachCrashReporting();

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;

            if (canReportNativeErrors)
            {
                PopulateCrashReportDirectoryStructure();

                if (hijackNativeSignals)
                {
                    IntPtr sigbus  = Marshal.AllocHGlobal(512);
                    IntPtr sigsegv = Marshal.AllocHGlobal(512);

                    // Store Mono SIGSEGV and SIGBUS handlers
                    sigaction(Signal.SIGBUS, IntPtr.Zero, sigbus);
                    sigaction(Signal.SIGSEGV, IntPtr.Zero, sigsegv);

                    NativeClient = NativeRaygunClient.SharedReporterWithApiKey(_apiKey);

                    // Restore Mono SIGSEGV and SIGBUS handlers
                    sigaction(Signal.SIGBUS, sigbus, IntPtr.Zero);
                    sigaction(Signal.SIGSEGV, sigsegv, IntPtr.Zero);

                    Marshal.FreeHGlobal(sigbus);
                    Marshal.FreeHGlobal(sigsegv);
                }
                else
                {
                    NativeClient = NativeRaygunClient.SharedReporterWithApiKey(_apiKey);
                }
            }
            return(this);
        }