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); }
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(); } }
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; } })); }
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 }
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) { } }
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; }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { LogManager.GetLog(typeof(UwCoreApp)).Error(e.Exception); }
// 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);
private void CurrentOnUnhandledException(object sender, UnhandledExceptionEventArgs e) { Logger.Fatal("CurrentOnUnhandledException", e.Exception); LogManager.Default.Flush(); }
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"); }
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(); }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { this.bugsnagClient.Notify(e.Exception, Severity.Error); }
private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; await ShowErrorDialog(e.Exception); }
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { ExceptionTracer.RequestBlueScreen(e.Exception); e.Handled = true; }
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(); }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { Debug.WriteLine(e.Message); Debugger.Break(); e.Handled = true; }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { LogManager.GetCurrentClassLogger().Fatal(e.Exception); }
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);
private async void OnAppUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; await new MessageDialog("OnAppUnhandledException:" + Environment.NewLine + e.Exception.Message).ShowAsync(); }
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(); }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; var errMsg = XamarinHelpers.ShowOkMessage("Error", $"An unexpected error occurred: \n{e.Exception}"); }
private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { await Utils.MessageBox(e.Message); e.Handled = true; }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = HandleExceptions.IsOn; }
protected override void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { e.Handled = true; OtherHelper.ShowContentDialog(e.Exception.ToString()); }
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { RollbarLocator.RollbarInstance.AsBlockingLogger(RollbarHelper.RollbarTimeout).Critical(e.Exception); }
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { Logger.Error("Unhanded exception: ", e.Exception); }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { Logger.Instance.Error(e.Exception, "Unhandled Exception"); }
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"); }
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) => LogException(e.Exception);
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { Logger.LogError(e.Exception); Logger.Log(e.Message); e.Handled = true; }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { // should log here, but we're not logging in this app }
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; }
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 }
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { #if DEBUG e.Handled = true; #endif }
private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) { System.Diagnostics.Debug.WriteLine(e.Exception.ToString()); }
private void WindowsRTApplication_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Debug.WriteLine(e.Message); }