Exemple #1
0
    static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
    {
        try
        {
            if (e.Exception.Message == "NoDriver calling waveInPrepareHeader")
            {
                //USB audio unplugged (typically the cause) - no other way to catch this exception in the volume level control due to limitation in NAudio
            }
            else
            {
                if (iSpyServer.iSpyServer.Default.Enable_Error_Reporting && _ReportedExceptionCount == 0 && e.Exception != null && e.Exception.Message != null && e.Exception.Message.ToString().Trim() != "")
                {
                    if (_ER == null)
                    {
                        _ER = new ErrorReporting();
                        _ER.UnhandledException = e.Exception;
                        _ER.ShowDialog();
                        _ER.Dispose();
                        _ER = null;
                        _ReportedExceptionCount++;
                    }

                }
            }
            MainForm.LogExceptionToFile(e.Exception);
        }
        catch (Exception ex2)
        {
            MainForm.LogExceptionToFile(ex2);
        }
    }
        public static void ConstructorTest()
        {
            var e = new ThreadExceptionEventArgs(null);
            Assert.Null(e.Exception);

            var ex = new Exception();
            e = new ThreadExceptionEventArgs(ex);
            Assert.Same(ex, e.Exception);
        }
    public static void HandleThreadException(object sender, ThreadExceptionEventArgs e)
    {
        string message = e.Exception.Message;
        string tempfile = Path.Combine(Path.GetTempPath(),"PhysicsIllustrator.txt");
        string text = String.Format("The following error occurred:\n\n{0}\n\nDetails will be saved to '{1}'.",message,tempfile);

        MessageBox.Show(text,Application.ProductName,MessageBoxButtons.OK,MessageBoxIcon.Stop);

        using (TextWriter tw = File.CreateText(tempfile))
        {
            tw.WriteLine(e.Exception.ToString());
        }

        System.Diagnostics.Process.Start(tempfile);
    }
Exemple #4
0
    private static void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
    {
        try
        {
            if (e.Exception.Message.IndexOf("NoDriver")!=-1)
            {
                //USB audio plugged/ unplugged (typically the cause) - no other way to catch this exception in the volume level control due to limitation in NAudio
            }
            else
            {
                if (MainForm.Conf.Enable_Error_Reporting && _reportedExceptionCount == 0 &&
                    e.Exception != null && e.Exception.Message.Trim() != "")
                {
                    if (_er == null)
                    {
                        _er = new ErrorReportingForm {UnhandledException = e.Exception};
                        _er.ShowDialog();
                        _er.Dispose();
                        _er = null;
                        _reportedExceptionCount++;
                    }
                }
            }
            Log.Error("", e.Exception);
        }
        catch (Exception ex2)
        {
            try
            {
                Log.Error("", ex2);
            }
            catch
            {

            }
        }
    }
Exemple #5
0
 static void VoucherPrinter_Error(object sender, ThreadExceptionEventArgs e)
 {
     Debug.Fail(e.Exception.Message, e.Exception.ToString());
 }
Exemple #6
0
 public static void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Engine.OnUnhandledException(e.Exception);
 }
Exemple #7
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     new FrmDisplayException(e.Exception).Show();
 }
Exemple #8
0
 private void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     // This is here to prevent unhandled exceptions from appearing in a message box.
 }
 private static void ApplicationOnThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Log.Fatal(e.Exception);
 }
Exemple #10
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Log.WriteError(e.Exception.Message, e.Exception);
 }
Exemple #11
0
 private void OnApplicationThreadException(object sender, ThreadExceptionEventArgs e)
 {
     ErrorDispatcher.DispatchFatalError(e.Exception);
 }
Exemple #12
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     MessageBox.Show(null, e.Exception.ToString(), "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Exemple #13
0
 void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     NotifyOfUnhandledException(e.Exception);
 }
 private static void applicationThreadException(
     object sender,
     ThreadExceptionEventArgs e)
 {
     doHandleException(e.Exception);
 }
Exemple #15
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// threadexceptioneventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ThreadExceptionEventHandler threadexceptioneventhandler, Object sender, ThreadExceptionEventArgs e, AsyncCallback callback)
        {
            if (threadexceptioneventhandler == null)
            {
                throw new ArgumentNullException("threadexceptioneventhandler");
            }

            return(threadexceptioneventhandler.BeginInvoke(sender, e, callback, null));
        }
Exemple #16
0
 /// <summary>
 /// Handles untrapper thread exception.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event parameter.</param>
 static void UnhandledThreadException(object sender, ThreadExceptionEventArgs e)
 {
     ExceptionWindow.Show(e.Exception);
 }
Exemple #17
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     JLog.Instance.Error(e.Exception.Message);
 }
Exemple #18
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     write_dump(e.Exception.ToString());
 }
Exemple #19
0
            public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
            {
                ExceptionReporter reporter = new ExceptionReporter();

                reporter.Show(e.Exception);
            }
Exemple #20
0
 private static void UIThread_UnhandledException(object sender, ThreadExceptionEventArgs e)
 {
     HandleException(e.Exception);
 }
Exemple #21
0
 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Utils.SaveLog("Application_ThreadException", e.Exception);
 }
Exemple #22
0
 private static void UIThreadException(object sender, ThreadExceptionEventArgs t)
 {
     MessageBox.Show(t.Exception.ToString(), "UIThreadException");
     Application.Exit();
 }
Exemple #23
0
 public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     AppData.ErrLog.WriteException(e.Exception, CommonPhrases.UnhandledException);
     ScadaUiUtils.ShowError(CommonPhrases.UnhandledException + ":\r\n" + e.Exception.Message);
 }
Exemple #24
0
 void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     LogException(e.Exception, true);
 }
Exemple #25
0
 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     MessageBox.Show(e.Exception.Message, "Unhandled Thread Exception");
     // here you can log the exception ...
 }
Exemple #26
0
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     OnError(e.Exception);
 }
 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Console.WriteLine("Unhandled Exception");
     Console.WriteLine(e.Exception.ToString());
 }
Exemple #28
0
 private static void OnApplicationThreadException(object sender, ThreadExceptionEventArgs e)
 {
     OnException(e.Exception);
 }
Exemple #29
0
        void OnUnhandledThreadException(object sender, ThreadExceptionEventArgs e)
        {
            var unhandledExceptionArgs = new UnhandledExceptionEventArgs(e.Exception, true);

            Callback.OnUnhandledException(Widget, unhandledExceptionArgs);
        }
Exemple #30
0
 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     Log4Neter.Error("未捕获异常", e.Exception);
 }
 private void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     HandleAllUnknownErrors(sender.ToString(), e.Exception);
 }
 public static void ExceptionHandler(object sender, ThreadExceptionEventArgs e)
 {
     CrashReporter.Instance.Write(e.Exception);
     Environment.Exit(1);
 }
Exemple #33
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 // ReSharper disable UnusedMember.Local
 // ReSharper disable UnusedParameter.Local
 private static void OnThreadException(object sender, ThreadExceptionEventArgs e)
 // ReSharper restore UnusedParameter.Local
 // ReSharper restore UnusedMember.Local
 {
   var result = DialogResult.Abort;
   try
   {
     result = MessageBox.Show(string.Format("{0}\n\n{1}{2}", Resources.UnhandledException, e.Exception.Message, e.Exception.StackTrace), Resources.ApplicationError, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
   }
   finally
   {
     if (result == DialogResult.Abort)
     {
       Application.Exit();
     }
   }
 }
Exemple #34
0
 public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
 {
     //HelpMsgBox._showSystemErrorMessage("Xin lỗi về sự bất tiện này. Vui lòng khởi động lại ứng dụng.\n Nếu vẫn xãy ra lỗi này vui lòng liên hệ đến Công ty PROTOCOL.", true);
     //HelpMsgBox.ShowNotificationMessage("Xin lỗi về sự bất tiện này. Vui lòng khởi động lại ứng dụng.\n Nếu vẫn xãy ra lỗi này vui lòng liên hệ đến Công ty PROTOCOL.");
     //MessageBox.Show(e.Exception.Message, "An exception occurred:", MessageBoxButtons.OK, MessageBoxIcon.Error);
     PLException.AddException(new PLException(e.Exception));
     frmFWUserError frm = new frmFWUserError(e);
     frm.ShowDialog();
 }
Exemple #35
0
	static void OnThreadException (object sender, ThreadExceptionEventArgs e)
	{
		_events.Add ("ThreadException:" + e.Exception.Message + " | " + e.Exception.GetType ().FullName);
	}
Exemple #36
0
 private static void Application_Errors(object sender, ThreadExceptionEventArgs t)
 {
     Log.Error(t.Exception.Message);
     Log.Error(t.Exception.StackTrace);
 }
 private void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     HandleException(e.Exception, nameof(Application_ThreadException));
 }
Exemple #38
0
 private static void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(e?.Exception?.Message) && e.Exception.Message.IndexOf("NoDriver", StringComparison.Ordinal)!=-1)
         {
             //USB audio plugged/ unplugged (typically the cause) - no other way to catch this exception in the volume level control due to limitation in NAudio
         }
         if (e!=null)
             Logger.LogExceptionToFile(e.Exception);
     }
     catch (Exception ex2)
     {
         try
         {
             Logger.LogExceptionToFile(ex2);
         }
         catch
         {
             
         }
     }
 }
Exemple #39
0
 private static void onThreadException(object sender, ThreadExceptionEventArgs e)
 {
     mfail(e.Exception, true);
 }
Exemple #40
0
        /// <summary>
        /// Catches all ui errors and writes them to the log as a fatal
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            Exception exception = e.Exception;

            WriteLine(exception.Message + Environment.NewLine + exception.StackTrace, logTypes.FATAL);
        }
 private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     HandleUnhandledException(e.Exception, false);
 }