コード例 #1
0
ファイル: App.xaml.cs プロジェクト: nthobois/7Pass
        private static void Application_UnhandledException(
            object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            var ex = e.ExceptionObject;

            AnalyticsTracker.Track(
                new TrackingEvent("error")
                {
                    {"type", ex.GetType().FullName},
                    {"stack", ex.StackTrace}
                });

            if (!Debugger.IsAttached)
            {
                e.Handled = true;

                var email = MessageBox.Show(
                    Properties.Resources.UnhandledExPrompt,
                    Properties.Resources.UnhandledExTitle,
                    MessageBoxButton.OKCancel) == MessageBoxResult.OK;

                if (email)
                {
                    ErrorReport.Report(ex);
                    return;
                }

                throw new QuitException();
            }

            Debugger.Break();
        }
コード例 #2
0
 private void OnAppUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (AppUnhandledException != null)
     {
         AppUnhandledException(e);
     }
 }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: sealong/practice
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (!Debugger.IsAttached) {
         e.Handled = true;
         Deployment.Current.Dispatcher.BeginInvoke(() => this.ReportErrorToDOM(e));
     }
 }
コード例 #4
0
        private static void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            try
            {
                string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
                errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");

                Tracer.Error(errorMsg);
                e.Handled = true;

                var control = new ExceptionControl();
                var viewModel = new ExceptionViewModel();

                viewModel.Exception = GenerateCrashReport(e.ExceptionObject);
                control.DataContext = viewModel;

                _gameHost.LayoutRoot.Children.Clear();
                _gameHost.LayoutRoot.Children.Add(control);
            }
            catch
            {
                try
                {
                    MessageBox.Show(e.ExceptionObject.ToString());
                }
                catch
                {
                    ReportErrorToDOM(e.ExceptionObject);
                }
            }
        }
コード例 #5
0
 // Code to execute on Unhandled Exceptions
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached) {
         // An unhandled exception has occurred; break into the debugger
         System.Diagnostics.Debugger.Break();
     }
 }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: follesoe/FrontEnd2010
        private static void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached) return;

            e.Handled = true;
            Deployment.Current.Dispatcher.BeginInvoke(() => ReportErrorToDOM(e));
        }
コード例 #7
0
ファイル: App.xaml.cs プロジェクト: Zekom/tracetool
        private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
        {
            try
               {
              //string errorMsg;
              //errorMsg = e.ExceptionObject.GetType().ToString();
              //errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
              //System.Windows.Browser.HtmlPage.Window.Eval("ttrace.display('" + errorMsg + "');");
              //
              //errorMsg = e.ExceptionObject.Message;
              //errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
              //System.Windows.Browser.HtmlPage.Window.Eval("ttrace.display('" + errorMsg + "');");
              //
              //
              //errorMsg = e.ExceptionObject.StackTrace ;
              //errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
              //System.Windows.Browser.HtmlPage.Window.Eval("ttrace.display('" + errorMsg + "');");

              ////System.Windows.Browser.HtmlPage.Window.Eval("ttrace.debug().send('" + errorMsg + "');");

              System.Windows.Browser.HtmlPage.Window.Eval("ttrace.display('ReportErrorToDOM error');");
               }
               catch (Exception)
               {
              System.Windows.Browser.HtmlPage.Window.Eval("ttrace.display('ReportErrorToDOM error');");
               }
        }
コード例 #8
0
ファイル: App.xaml.cs プロジェクト: krt/OpenTouryo
        /// <summary>未処理例外発生イベントハンドラ</summary>
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            // アプリケーションがデバッガーの外側で実行されている場合、ブラウザーの
            // 例外メカニズムによって例外が報告されます。これにより、IE ではステータス バーに
            // 黄色の通知アイコンが表示され、Firefox にはスクリプト エラーが表示されます。
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                // メモ : これにより、アプリケーションは例外がスロー
                // された後も実行され続け、例外はハンドルされません。 
                // 実稼動アプリケーションでは、このエラー処理は、Web サイトにエラーを
                // 報告し、アプリケーションを停止させるものに置換される必要があります。
                e.Handled = true;

                // JavaScriptで例外レポートを報告
                Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
            }

            // MessageBoxで例外情報表示
            MessageBox.Show(e.ExceptionObject.Message);

            // MessageBoxで内部例外情報表示
            if (e.ExceptionObject.InnerException != null)
            {
                MessageBox.Show(e.ExceptionObject.InnerException.Message);
            }
        }
コード例 #9
0
ファイル: App.xaml.cs プロジェクト: RandyCode/SimpleTools
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            //MessageBox.Show(e.ExceptionObject.Message);
            try
            {
                if (RootVisual == null)
                {
                    string msg = e.ExceptionObject.Message;
                    if (e.ExceptionObject is CustomException)
                    {
                        CustomException csEx = (CustomException)e.ExceptionObject;
                        msg = csEx.ExceptionMessage;
                    }
                    System.Windows.MessageBox.Show(msg);
                    return;
                }
                else if (RootVisual.CheckAccess())  //是否能线程访问
                {
                    HandleAppException(e);
                }
                else
                {
                    RootVisual.Dispatcher.BeginInvoke(() =>
                    {
                        HandleAppException(e);
                    });
                }
            }
            catch (Exception)
            {

            }
            e.Handled = true;
            return;
        }
コード例 #10
0
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (!System.Diagnostics.Debugger.IsAttached)
     {
     }
     e.Handled = true;
 }
コード例 #11
0
ファイル: App.xaml.cs プロジェクト: jimmccurdy/ArchiveGit
		private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
		{
			// Allow the application to continue running after an exception has been thrown but not handled
			Exception ex = e.ExceptionObject;
			ex.Alert();
			e.Handled = true;
		}
コード例 #12
0
ファイル: App.xaml.cs プロジェクト: ArildF/Smeedee
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            try
            {
                ILog logger = new Logger(new Framework.SL.Repositories.LogEntryWebserviceRepository());
                ErrorLogEntry error = new ErrorLogEntry()
                {
                    Message = e.ExceptionObject.ToString(),
                    Source = "UNHANDLED IN: " + sender.GetType().ToString(),
                    TimeStamp = DateTime.Now
                };

                logger.WriteEntry(error);
                e.Handled = true;
            }
            catch (Exception logException)
            {
                // If the app is running outside of the debugger then report the exception using
                // the browser's exception mechanism. On IE this will display it a yellow alert 
                // icon in the status bar and Firefox will display a script error.
                if (!System.Diagnostics.Debugger.IsAttached)
                {
                    // NOTE: This will allow the application to continue running after an exception has been thrown
                    // but not handled. 
                    // For production applications this error handling should be replaced with something that will 
                    // report the error to the website and stop the application.
                    e.Handled = true;
                    //MessageBox.Show(e.ExceptionObject.Message);
                    //Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
                }
            }
        }
コード例 #13
0
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
		{
			if (System.Diagnostics.Debugger.IsAttached) return;

			e.Handled = true;
			ErrorPresenter.Show(e.ExceptionObject);
		}
コード例 #14
0
ファイル: App.xaml.cs プロジェクト: xximjasonxx/Codemash
 void App_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (e.ExceptionObject.GetType() == typeof (NoInternetConnectionException))
         MessageBox.Show("Could not find an Internet connection - please try again later");
     else
         MessageBox.Show("An error occured - the application will now close");
 }
コード例 #15
0
ファイル: App.xaml.cs プロジェクト: nikhildhawan/c2dm
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         System.Diagnostics.Debugger.Break();
     }
 }
コード例 #16
0
ファイル: App.xaml.cs プロジェクト: shaftware/Torch
 private void App_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (Debugger.IsAttached)
     {
         Debugger.Break();
     }
 }
コード例 #17
0
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            // If the app is running outside of the debugger then report the exception using
            // the browser's exception mechanism. On IE this will display it a yellow alert
            // icon in the status bar and Firefox will display a script error.
            if (!System.Diagnostics.Debugger.IsAttached)
            {

                // NOTE: This will allow the application to continue running after an exception has been thrown
                // but not handled.
                // For production applications this error handling should be replaced with something that will
                // report the error to the website and stop the application.
                e.Handled = true;

                try
                {
                    string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
                    errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");

                    System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");");
                }
                catch (Exception)
                {
                }
            }
        }
コード例 #18
0
ファイル: App.xaml.cs プロジェクト: e82eric/Prompts
        private static void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
        {
            var errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
            errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");

            System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
        }
コード例 #19
0
ファイル: App.xaml.cs プロジェクト: DuBin1988/newsellinggas
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
     //errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
     e.Handled = false;
     MessageBox.Show(errorMsg);
 }
コード例 #20
0
 protected override void OnUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     MessageBox.Show("Unexpected problem occured. Application will be closed." +
                     (System.Diagnostics.Debugger.IsAttached ? '\n' + e.ExceptionObject.Message : ""),
                     "Unexpected problem", MessageBoxButton.OK);
     base.OnUnhandledException(sender, e);
 }
コード例 #21
0
ファイル: App.xaml.cs プロジェクト: ynosa/KanbanBoard
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (e.ExceptionObject is DomainOperationException)
            {
                if (((DomainOperationException)e.ExceptionObject).Status == OperationErrorStatus.Unauthorized)
                {
                    System.Windows.MessageBox.Show("Your session has expired please login.", "Session expired", MessageBoxButton.OK);
                    WebContextBase.Current.Authentication.Logout(null, null);
                    e.Handled = true;
                    return;
                }
            }

            // If the app is running outside of the debugger then report the exception using
            // the browser's exception mechanism. On IE this will display it a yellow alert
            // icon in the status bar and Firefox will display a script error.
            if (!System.Diagnostics.Debugger.IsAttached)
            {

                // NOTE: This will allow the application to continue running after an exception has been thrown
                // but not handled.
                // For production applications this error handling should be replaced with something that will
                // report the error to the website and stop the application.
                e.Handled = true;
                Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
            }
        }
コード例 #22
0
ファイル: App.xaml.cs プロジェクト: gezidan/ZYSOCKET
		private void Application_UnhandledException( object sender, ApplicationUnhandledExceptionEventArgs e )
		{
			if ( Debugger.IsAttached )
			{
				Debug.WriteLine( e.ExceptionObject );
				Debugger.Break();
			}
		}
コード例 #23
0
 private void OnUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs args)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(CreateHeader());
     builder.AppendLine();
     builder.Append(CreateStackTrace(args));
     SaveLog(builder.ToString());
 }
コード例 #24
0
ファイル: App.xaml.cs プロジェクト: bonus/Praxis
 private static void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (!Debugger.IsAttached)
     {
         e.Handled = true;
         Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDom(e); });
     }
 }
コード例 #25
0
 // Code, der bei nicht behandelten Ausnahmen ausgeführt wird
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         // Eine nicht behandelte Ausnahme ist aufgetreten. Unterbrechen und Debugger öffnen
         System.Diagnostics.Debugger.Break();
     }
 }
コード例 #26
0
 /// 發生未處理的例外狀況時要執行的程式碼
 private void ScheduledAgent_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         // 發生未處理的例外狀況; 切換到偵錯工具
         System.Diagnostics.Debugger.Break();
     }
 }
コード例 #27
0
ファイル: ScheduledAgent.cs プロジェクト: no2key/wp7-app
 /// 出现未处理的异常时执行的代码
 private void ScheduledAgent_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if ( System. Diagnostics. Debugger. IsAttached )
     {
         // 出现未处理的异常;强行进入调试器
         System. Diagnostics. Debugger. Break( );
     }
 }
コード例 #28
0
ファイル: ScheduledAgent.cs プロジェクト: modulexcite/BinDays
        void GlobalUnhandledExceptionHandler(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (Debugger.IsAttached)
                Debugger.Break();

            e.Handled = true;
            NotifyComplete();
        }
コード例 #29
0
 /// Code to execute on Unhandled Exceptions
 static void UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (Debugger.IsAttached)
     {
         // An unhandled exception has occurred; break into the debugger
         Debugger.Break();
     }
 }
コード例 #30
0
    void Current_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) {
//#if !DEBUG
      if (!e.Handled) {
        e.Handled = true;
        msgBx.ShowError(EBioException.CreateIfNotEBio(e.ExceptionObject), "Непредвиденная ошибка!", null);
      }
//#endif
    }
コード例 #31
0
        /// <summary>
        /// Something bad has happened in the applicaiton
        /// </summary>
        /// <param name="sender">Responsible party</param>
        /// <param name="e">The arguments coming in with the Event</param>
        protected override void OnUnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // An unhandled exception has occurred; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
            else
            {
#if DEBUG
                MessageBox.Show(e.ExceptionObject.Message + " " + e.ExceptionObject.StackTrace);
#else
                // do something sensible for production
#endif
                e.Handled = true;
            }
        }