where to show the error
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
using ReactiveUI;
using System;
using System.IO;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Windows.Input;
using System.Reactive.Linq;
@@ -51,13 +52,18 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
RecoverWalletCommand = ReactiveCommand.Create(
() => { Navigate().To(new RecoverWalletViewModel(WalletName, network, walletManager)); });
- ImportWalletCommand = ReactiveCommand.Create(() => new ImportWalletViewModel(WalletName, walletManager));
+ ImportWalletCommand = ReactiveCommand.Create(() => new ImportWalletViewModel(WalletName, walletManager){ CurrentTarget = NavigationTarget.HomeScreen});
ConnectHardwareWalletCommand = ReactiveCommand.Create(() =>
{
Navigate().To(new ConnectHardwareWalletViewModel(WalletName, network, walletManager));
});
+ ExceptionCommand = ReactiveCommand.Create(() =>
+ {
+ ShowError("asdadadaad");
+ });
+
CreateWalletCommand = ReactiveCommand.CreateFromTask(
async () =>
{
@@ -89,6 +95,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, walletManager, WalletName));
}
+ public ReactiveCommand<Unit, Unit> ExceptionCommand { get; set; }
+
protected override void OnNavigatedTo(bool inStack, CompositeDisposable disposable)
{
base.OnNavigatedTo(inStack, disposable);

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
@@ -14,6 +14,9 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
WalletName = walletName;
+ Title = "Hardware Wallet";
+ ErrorCaption = "Error occured during adding your wallet.";
+
switch (hardwareWalletOperations.SelectedDevice!.Model)
{
case HardwareWalletModels.Coldcard:
@@ -50,7 +53,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
}
catch(Exception ex)
{
- FluentLogger.ShowAndLogError(ex);
+ ShowError(ex.Message);
Navigate().Back();
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/ImportWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/ImportWalletViewModel.cs
@@ -8,6 +8,7 @@ using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Helpers;
+using WalletWasabi.Logging;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.AddWallet
@@ -59,7 +60,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
}
catch (Exception ex)
{
- // FluentLogger.ShowAndLogError(ex);
+ Logger.LogError(ex);
ShowError(ex.Message);
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShowErrorDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShowErrorDialogViewModel.cs
@@ -10,7 +10,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
Title = title;
Caption = caption;
- NextCommand = ReactiveCommand.Create(() => Close());
+ NextCommand = ReactiveCommand.Create(() => Navigate().Back());
}
public string Message { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -116,7 +116,7 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
protected void ShowError(string message)
{
var dialog = new ShowErrorDialogViewModel(message, Title, ErrorCaption);
- dialog.ShowDialogAsync();
+ NavigateDialog(dialog, CurrentTarget == NavigationTarget.HomeScreen ? NavigationTarget.DialogScreen : CurrentTarget);
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
@@ -7,6 +7,7 @@ using WalletWasabi.Blockchain.TransactionBroadcasting;
using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Logging;
using WalletWasabi.Stores;
namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
@@ -37,6 +38,9 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
TransactionBroadcaster broadcaster,
SmartTransaction transaction)
{
+ Title = "Broadcast Transaction";
+ ErrorCaption = "It was not possible to broadcast the transaction.";
+
var nullMoney = new Money(-1L);
var nullOutput = new TxOut(nullMoney, Script.Empty);
@@ -87,7 +91,8 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
}
catch (Exception ex)
{
- FluentLogger.ShowAndLogError(ex);
+ Logger.LogError(ex);
+ ShowError(ex.Message);
}
Navigate().Back();

MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/LoadTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/LoadTransactionViewModel.cs
@@ -21,6 +21,9 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
{
Network = network;
+ Title = "Transaction Broadcaster";
+ ErrorCaption = "It was not possible to load the transaction.";
+
this.WhenAnyValue(x => x.FinalTransaction)
.Where(x => x is { })
.ObserveOn(RxApp.MainThreadScheduler)
@@ -40,6 +43,7 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
catch (Exception ex)
{
Logger.LogError(ex);
+ ShowError(ex.Message);
}
},
outputScheduler: RxApp.MainThreadScheduler);
@@ -71,7 +75,8 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
}
catch (Exception ex)
{
- FluentLogger.ShowAndLogError(ex);
+ Logger.LogError(ex);
+ ShowError(ex.Message);
}
});
}

MODIFY
WalletWasabi.Fluent/Views/AddWallet/AddWalletPageView.axaml
WalletWasabi.Fluent/Views/AddWallet/AddWalletPageView.axaml
<c:TileButton Text="Recover a wallet"
Icon="{StaticResource recover_arrow_right_regular}"
Command="{Binding RecoverWalletCommand}"/>
+ <c:TileButton Text="Exception"
+ Icon="{StaticResource recover_arrow_right_regular}"
+ Command="{Binding ExceptionCommand}"/>
</WrapPanel>
</DockPanel>
</c:ContentArea>

MODIFY
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
x:DataType="hardwareWallet:DetectedHardwareWalletViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.AddWallet.HardwareWallet.DetectedHardwareWalletView">
- <c:ContentArea Title="Hardware Wallet"
+ <c:ContentArea Title="{Binding Title}"
IsBusy="{Binding IsBusy}"
EnableCancel="False"
EnableBack="False"

MODIFY
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
x:DataType="transactionBroadcasting:BroadcastTransactionViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.TransactionBroadcasting.BroadcastTransactionView">
- <c:ContentArea Title="Broadcast Transaction"
+ <c:ContentArea Title="{Binding Title}"
Caption="{Binding TransactionId}"
EnableCancel="{Binding !IsBusy}"
EnableNext="True" NextContent="Broadcast">

MODIFY
WalletWasabi.Fluent/Views/TransactionBroadcasting/LoadTransactionView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcasting/LoadTransactionView.axaml
x:DataType="transactionBroadcasting:LoadTransactionViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.TransactionBroadcasting.LoadTransactionView">
-<c:ContentArea Title="Transaction Broadcaster"
+<c:ContentArea Title="{Binding Title}"
Caption="Paste or import the transaction and broadcast it to the network."
EnableCancel="True">
<StackPanel Orientation="Horizontal" Spacing="50" HorizontalAlignment="Center" VerticalAlignment="Center">

MODIFY
WalletWasabi.Fluent/Views/Wallets/LoginView.axaml
WalletWasabi.Fluent/Views/Wallets/LoginView.axaml
<behaviors:FocusOnAttachedBehavior />
</i:Interaction.Behaviors>
</TextBox>
- <Button Content="Login" Classes="action" HorizontalAlignment="Right" Click="Button_OnClick" />
+ <Button Content="Login" Classes="action" HorizontalAlignment="Right" />
</StackPanel>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/LoginView.xaml.cs
WalletWasabi.Fluent/Views/Wallets/LoginView.xaml.cs
@@ -17,10 +17,5 @@ namespace WalletWasabi.Fluent.Views.Wallets
{
AvaloniaXamlLoader.Load(this);
}
-
- private void Button_OnClick(object? sender, RoutedEventArgs e)
- {
- FluentLogger.ShowAndLogError(new Exception("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."));
- }
}
}

where to show the error