handle exception in UI
MODIFY
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenConfigFileViewModel.cs
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenConfigFileViewModel.cs
+using System;
using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
@@ -17,6 +18,17 @@ namespace WalletWasabi.Fluent.ViewModels.OpenDirectory
public partial class OpenConfigFileViewModel : TriggerCommandViewModel
{
public override ICommand TargetCommand =>
- ReactiveCommand.Create(() => FileHelpers.OpenFileInTextEditorAsync(Services.Config.FilePath));
+ ReactiveCommand.Create(async () =>
+ {
+ try
+ {
+ await FileHelpers.OpenFileInTextEditorAsync(Services.Config.FilePath);
+ }
+ catch (Exception ex)
+ {
+ await ShowErrorAsync("Open", ex.Message, "Wasabi was unable to open the file");
+ }
+
+ });
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenLogsViewModel.cs
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenLogsViewModel.cs
+using System;
using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
@@ -18,6 +19,16 @@ namespace WalletWasabi.Fluent.ViewModels.OpenDirectory
public partial class OpenLogsViewModel : TriggerCommandViewModel
{
public override ICommand TargetCommand =>
- ReactiveCommand.Create(() => FileHelpers.OpenFileInTextEditorAsync(Logger.FilePath));
+ ReactiveCommand.CreateFromTask(async () =>
+ {
+ try
+ {
+ await FileHelpers.OpenFileInTextEditorAsync(Logger.FilePath);
+ }
+ catch (Exception ex)
+ {
+ await ShowErrorAsync("Open", ex.Message, "Wasabi was unable to open the file");
+ }
+ });
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenTorLogsViewModel.cs
WalletWasabi.Fluent/ViewModels/OpenDirectory/OpenTorLogsViewModel.cs
+using System;
using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
@@ -17,6 +18,16 @@ namespace WalletWasabi.Fluent.ViewModels.OpenDirectory
public partial class OpenTorLogsViewModel : TriggerCommandViewModel
{
public override ICommand TargetCommand =>
- ReactiveCommand.Create(() => FileHelpers.OpenFileInTextEditorAsync(Services.TorSettings.LogFilePath));
+ ReactiveCommand.CreateFromTask(async () =>
+ {
+ try
+ {
+ await FileHelpers.OpenFileInTextEditorAsync(Services.TorSettings.LogFilePath);
+ }
+ catch (Exception ex)
+ {
+ await ShowErrorAsync("Open", ex.Message, "Wasabi was unable to open the file");
+ }
+ });
}
}

handle exception in UI