Exemple #1
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);
        }
Exemple #2
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);
        }