Inheritance: IUnhandledExceptionEventArgs
Ejemplo n.º 1
0
        private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            // Do not crash.
            e.Handled = true;

            // Global error handler.
            var rootFrame = Window.Current.Content as Frame;
            if (rootFrame != null)
                rootFrame.Navigate(typeof(MainPage), e.Exception);
        }
Ejemplo n.º 2
0
        private async void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            try
            {
                var dialog = new MessageDialog("Ooops! We didn't anticipate this: " + e.Exception.Message);
                dialog.Commands.Add(new UICommand {
                    Label = "Ok", Id = 0
                });

                var result = await dialog.ShowAsync();
            }
            catch
            {
                var dialog = new MessageDialog("An unhandled error occurred.");
                dialog.Commands.Add(new UICommand {
                    Label = "Ok", Id = 0
                });

                var result = await dialog.ShowAsync();
            }
        }
Ejemplo n.º 3
0
 private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Common.Invoke((async() =>
     {
         ContentDialog Dialog = new ContentDialog
         {
             Title = "遇到了错误",
             Content = e.Exception.ToString(),
             CloseButtonText = "忽略",
             PrimaryButtonText = "退出"
         };
         ContentDialogResult result = await Dialog.ShowAsync();
         if (result == ContentDialogResult.Primary)
         {
             Environment.Exit(-1);
         }
         else
         {
             e.Handled = true;
         }
     }));
 }
Ejemplo n.º 4
0
        private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            DebugLogger.Log("Unhandled fatal application exception: " + e.Exception.ToString());
            var localSettings = ApplicationData.Current.LocalSettings.Values;
            var exStr         = e.Exception.ToString() + "\r\n" + e.Message + "\r\n" + e.Exception.StackTrace;

            if (localSettings.TryGetValue("lastError", out var lastErr) && lastErr is string lastErrStr)
            {
                lastErrStr += "\r\n" + exStr;
            }
            else
            {
                lastErrStr = exStr;
            }
            localSettings["lastError"] = lastErrStr;
            if (e.Exception.InnerException != null)
            {
                DebugLogger.Log("Unhandled fatal application inner exception: " + e.Exception.InnerException.ToString());
            }
#if !DEBUG
            e.Handled = true;
#endif
        }
Ejemplo n.º 5
0
        private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            if (e.Exception is NullReferenceException n)
            {
                // ignore a weird exception from data binding
                if (n.StackTrace?.Contains("Aurora.Music.Controls.ListItems") ?? false)
                {
                    return;
                }
            }
            Core.Tools.Helper.Logging(e);

            if (MainPage.Current is MainPage p
#if !DEBUG
                && (e.Exception is NotImplementedException || e.Exception is UnauthorizedAccessException)
#endif
                )
            {
                p.ThrowException(e);
            }

            try
            {
                if (Window.Current?.Content is Frame f)
                {
                    if (f.Content is WelcomePage)
                    {
                        Settings.Current.WelcomeFinished = true;
                        Settings.Current.Save();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 6
0
        private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            if (UnhandledExceptionTimes <= 10)
            {
                parameters.ErrorMessage = e.Exception.Message;
                parameters.StackTrace   = e.Exception.StackTrace;
                parameters.AutoNavigate = true;
            }
            else
            {
                parameters.ErrorMessage = e.Exception.Message;
                parameters.StackTrace   = e.Exception.StackTrace;
                parameters.AutoNavigate = false;
            }

            //Just in case exception is not reported during testing.
            Analytics.TrackEvent("Exception occurred");

            Frame rootFrame = Window.Current.Content as Frame;

            rootFrame.Navigate(typeof(UnhandledExceptionPage), parameters);
            UnhandledExceptionTimes++;
            e.Handled = true;
        }
Ejemplo n.º 7
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     LogManager.GetLog(typeof(UwCoreApp)).Error(e.Exception);
 }
Ejemplo n.º 8
0
 // Occurs when an exception is not handled on the UI thread.
 private static void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) => AppUnhandledException(e.Exception);
Ejemplo n.º 9
0
 private void CurrentOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Logger.Fatal("CurrentOnUnhandledException", e.Exception);
     LogManager.Default.Flush();
 }
Ejemplo n.º 10
0
        private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            var logger = App.ServiceProvider.GetService(typeof(ILogger <App>)) as ILogger <App>;

            logger.LogError(e.Exception, "Unhandled");
        }
Ejemplo n.º 11
0
 private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     await new MessageDialog(e.Exception.StackTrace, e.Exception.Message).ShowAsync();
 }
Ejemplo n.º 12
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     this.bugsnagClient.Notify(e.Exception, Severity.Error);
 }
Ejemplo n.º 13
0
        private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            e.Handled = true;

            await ShowErrorDialog(e.Exception);
        }
Ejemplo n.º 14
0
 private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     ExceptionTracer.RequestBlueScreen(e.Exception);
     e.Handled = true;
 }
Ejemplo n.º 15
0
 private async void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     await new MessageDialog("Application Unhandled Exception:\r\n" + GetExceptionDetailMessage(e.Exception), "爆了 :(")
     .ShowAsync();
 }
Ejemplo n.º 16
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     Debug.WriteLine(e.Message);
     Debugger.Break();
     e.Handled = true;
 }
Ejemplo n.º 17
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     LogManager.GetCurrentClassLogger().Fatal(e.Exception);
 }
Ejemplo n.º 18
0
 private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Services.LogService.ErrorWrite(e.Exception, sender.ToString());
 }
 private void OnCurrentApplicationUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.Handled = this.HandleException(e.Exception);
 }
 /// <summary>
 /// Gets called if an exception was thrown that was not handled by user-code.
 /// </summary>
 /// <param name="eventArguments">The event arguments that contain further information about the exception that was not properly handled by user-code.</param>
 protected virtual Task OnUnhandledExceptionAsync(UnhandledExceptionEventArgs eventArguments) => Task.FromResult(0);
Ejemplo n.º 21
0
 private async void OnAppUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     await new MessageDialog("OnAppUnhandledException:" + Environment.NewLine + e.Exception.Message).ShowAsync();
 }
Ejemplo n.º 22
0
        private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            // say we've handled this one. this allows our FATAL write to complete.
            e.Handled = true;

            var ex = ExceptionUtils.UnwrapException(e.Exception);

            await ((ILoggerAsync)log).FatalAsync("CRASH!", ex);

            // if we're aborting, fake a suspend to flush the targets...
            await LazyFlushManager.FlushAllAsync(new LogWriteContext());

            ApplicationData.Current.LocalSettings.Values[LocalSettingsKeys.LogsUploadPending] = true;

            // abort the app here...
            Current.Exit();
        }
Ejemplo n.º 23
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     var errMsg = XamarinHelpers.ShowOkMessage("Error", $"An unexpected error occurred: \n{e.Exception}");
 }
Ejemplo n.º 24
0
 private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     await Utils.MessageBox(e.Message);
     e.Handled = true;
 }
Ejemplo n.º 25
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.Handled = HandleExceptions.IsOn;
 }
Ejemplo n.º 26
0
 protected override void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
 }
Ejemplo n.º 27
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     OtherHelper.ShowContentDialog(e.Exception.ToString());
 }
Ejemplo n.º 28
0
 private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     RollbarLocator.RollbarInstance.AsBlockingLogger(RollbarHelper.RollbarTimeout).Critical(e.Exception);
 }
Ejemplo n.º 29
0
 private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     Logger.Error("Unhanded exception: ", e.Exception);
 }
Ejemplo n.º 30
0
 private async void OnAppUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     await new MessageDialog("OnAppUnhandledException:" + Environment.NewLine + e.Exception.Message).ShowAsync();
 }
Ejemplo n.º 31
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     Logger.Instance.Error(e.Exception, "Unhandled Exception");
 }
Ejemplo n.º 32
0
 private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     // define DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
     // to turn off the default debugger break
     Logging.WriteLogMessage(e?.Exception?.ToString() ?? "Invalid exception in backstop handler");
 }
Ejemplo n.º 33
0
 private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) => LogException(e.Exception);
Ejemplo n.º 34
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Logger.LogError(e.Exception);
     Logger.Log(e.Message);
     e.Handled = true;
 }
Ejemplo n.º 35
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     // should log here, but we're not logging in this app
 }
Ejemplo n.º 36
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     IEventAggregator eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
     eventAggregator.GetEvent<Events.DebugEvent>().Publish(new DebugEventArgs(e.Exception));
     e.Handled = true;
 }
Ejemplo n.º 37
0
 private void OnAppUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     // TODO WTS: Please log and handle the exception as appropriate to your scenario
     // For more info see https://docs.microsoft.com/uwp/api/windows.ui.xaml.application.unhandledexception
 }
Ejemplo n.º 38
0
        private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
#if DEBUG
            e.Handled = true;
#endif
        }
Ejemplo n.º 39
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine(e.Exception.ToString());
 }
Ejemplo n.º 40
0
 private void WindowsRTApplication_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Debug.WriteLine(e.Message);
 }