Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
某种程度的崩溃记录
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed Sep 20, 2019
1 parent 005a313 commit 5079edc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PixivFSUWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
Expand All @@ -30,6 +31,15 @@ public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
this.UnhandledException += App_UnhandledException;
}

private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
{
e.Handled = true;
MessageDialog dialog = new MessageDialog(string.Format("Unhandled Execption: {0}\nPlease screenshot for later use.", e.Exception.Message), "Exception");
await dialog.ShowAsync();
this.Exit();
}

protected override void OnActivated(IActivatedEventArgs args)
Expand Down

0 comments on commit 5079edc

Please sign in to comment.