Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Better issue handling for #125
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Feb 27, 2020
1 parent eb0c672 commit cf1cd90
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion UWPX_UI/Dialogs/ConfirmDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<controls:MarkdownTextBlock x:Name="text_mrkdwn"
Margin="10"
LinkClicked="Text_mrkdwn_LinkClicked"
Text="{x:Bind MarkdownText, Mode=OneWay}"/>
Text="{x:Bind MarkdownText, Mode=OneWay}"
TextWrapping="Wrap"/>
</ScrollViewer>
<Grid x:Name="buttons_grid"
Grid.Row="1"
Expand Down
3 changes: 2 additions & 1 deletion UWPX_UI/Dialogs/InfoDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<controls:MarkdownTextBlock x:Name="text_mrkdwn"
Margin="10"
LinkClicked="MarkdownTextBlock_LinkClicked"
Text="{x:Bind MarkdownText, Mode=OneWay}"/>
Text="{x:Bind MarkdownText, Mode=OneWay}"
TextWrapping="Wrap"/>
</ScrollViewer>
</ContentDialog>
26 changes: 24 additions & 2 deletions UWPX_UI/Pages/Settings/MiscSettingsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using UWPX_UI.Dialogs;
using System;
using Logging;
using Microsoft.AppCenter.Crashes;
using UWPX_UI.Dialogs;
using UWPX_UI.Extensions;
using UWPX_UI_Context.Classes;
using UWPX_UI_Context.Classes.DataContext.Pages;
Expand Down Expand Up @@ -103,7 +106,26 @@ private async void DeleteLogs_btn_Click(object sender, RoutedEventArgs e)

private async void ExportLogs_btn_Click(object sender, RoutedEventArgs e)
{
await VIEW_MODEL.ExportLogsAsync();
try
{
// await VIEW_MODEL.ExportLogsAsync();
throw new Exception("TEST EXEPTION");
}
catch (Exception ex)
{
Logger.Error("Failed to export logs:", ex);
ConfirmDialog dialog = new ConfirmDialog("Export Failed", "Exporting logs failed with the following issue:\n\n" + ex.Message + "\n\n" + ex.StackTrace + "\n\nWould you like to automatically report this crash?\n\n**Else, please report it here:**\n\n[GitHub#125](https://github.com/UWPX/UWPX-Client/issues/125)");
await UiUtils.ShowDialogAsync(dialog);
if (dialog.VIEW_MODEL.MODEL.Confirmed)
{
Crashes.TrackError(ex);
Logger.Info("Crash in ExportLogsAsync() has been reported.");
}
else
{
Logger.Info("Reporting ExportLogsAsync() crash canceled.");
}
}
}

private async void ClearImageCache_btn_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit cf1cd90

Please sign in to comment.