コード例 #1
0
 private static void OnDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         System.Diagnostics.Debugger.Break();
     }
     OSDispatcher.Current.InvokeOnMainDispatcher(() => ReportDomainUnhandledException(e.ExceptionObject as System.Exception));
 }
コード例 #2
0
ファイル: App.cs プロジェクト: ckimpel/FSE-2011-PDE
 private void AppDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     if (System.Windows.Application.Current != null)
     {
         if ((System.Windows.Application.Current.MainWindow as DslEditorMainWindow) != null)
         {
             HandleException(e.ExceptionObject as System.Exception, (System.Windows.Application.Current.MainWindow as DslEditorMainWindow).DocData);
         }
     }
 }
コード例 #3
0
        private static void HandleUnhandledException(object sender, System.UnhandledExceptionEventArgs args)
        {
            if (args == null || args.ExceptionObject == null)
            {
                return;
            }

            if (args.ExceptionObject.GetType() == typeof(System.Exception))
            {
                System.Exception e = (System.Exception)args.ExceptionObject;
                OnLogHandler(string.Format("Unhandled Exception at {0}", e.Source), e.StackTrace, LogType.Exception);
            }
        }
コード例 #4
0
 private static void OnDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         System.Diagnostics.Debugger.Break();
     }
     if (NSThread.IsMain)
     {
         ReportDomainUnhandledException(e.ExceptionObject as System.Exception);
     }
     else
     {
         Current.BeginInvokeOnMainThread(() => ReportDomainUnhandledException(e.ExceptionObject as System.Exception));
     }
 }
コード例 #5
0
    static void ExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
    {
        System.Exception e             = (System.Exception)args.ExceptionObject;
        string           exceptionData = e.Message + System.Environment.NewLine + e.StackTrace;

        byte[] outputData = System.Text.Encoding.ASCII.GetBytes(exceptionData);
        // do not dump or close if in a debugger.
        if (!System.Diagnostics.Debugger.IsAttached)
        {
            System.IO.FileStream fileStream = System.IO.File.OpenWrite(Els_kom_Core.Classes.SettingsFile.ErrorLogPath);
            fileStream.Write(outputData, 0, outputData.Length);
            fileStream.Dispose();
            Els_kom_Core.Classes.MiniDump.FullMiniDumpToFile(Els_kom_Core.Classes.SettingsFile.MiniDumpPath);
            System.Windows.Forms.MessageBox.Show("Please send a copy of " + Els_kom_Core.Classes.SettingsFile.ErrorLogPath + " to https://github.com/Elskom/Els_kom_new/issues by making an issue and attaching the log(s) and mini-dump(s).", "Unhandled Exception!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            System.Windows.Forms.Application.Exit();
        }
    }
コード例 #6
0
        static void UnhandledExceptionCallback(object sender, System.UnhandledExceptionEventArgs args)
        {
            if (_sent)
            {
                return;
            }

            if (args == null || args.ExceptionObject == null)
            {
                return;
            }

            System.Exception e = args.ExceptionObject as System.Exception;
            if (e != null)
            {
                _sent = true;
                AddData("type", "crash");
                AddData("name", e.GetType().ToString());
                AddData("message", e.Message);
                AddData("sender", "UnhandledExceptionCallback" + sender.ToString());
                AddData("stack", StackTrace(e));
                Coroutines.Run(SendBugReport());
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: w8w8w8/Lumisoft.Net.Core
 /// <summary>
 /// This is called when unhandled exception happened.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     //System.Windows.Forms.MessageBox.Show("Error: " + ((Exception)e.ExceptionObject).ToString(), "Error:", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
     System.Console.WriteLine("Error: " + ((System.Exception)e.ExceptionObject).ToString(), "Error:");
 }
コード例 #8
0
ファイル: Lizard.cs プロジェクト: EmpioDavion/Lizard
 private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs ex)
 {
     Externs.MessageBox("Error!", ex.ExceptionObject.ToString());
 }
コード例 #9
0
        } // End Sub CurrentDomain_ProcessExit

        // Catch unhandled exceptions
        private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            System.Console.WriteLine(((System.Exception)e.ExceptionObject).Message, "Error");
            OnExit();
        } // End Sub CurrentDomain_UnhandledException
コード例 #10
0
 private static void HandleUnhandledExceptionEvent(Object sender, System.UnhandledExceptionEventArgs e)
 {
     //write details to file or output to console, popup message, etc.
 }