From 601b8ff4f5e6595ac2b33e2905df5c2fd21d4d24 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 22 Sep 2023 23:59:17 -0400 Subject: [PATCH] Use inner exceptions for relay notification errors --- .../Extensions/RelayCommandExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/StabilityMatrix.Avalonia/Extensions/RelayCommandExtensions.cs b/StabilityMatrix.Avalonia/Extensions/RelayCommandExtensions.cs index bbbdf8c4..7f88704d 100644 --- a/StabilityMatrix.Avalonia/Extensions/RelayCommandExtensions.cs +++ b/StabilityMatrix.Avalonia/Extensions/RelayCommandExtensions.cs @@ -48,7 +48,7 @@ public static class RelayCommandExtensions && senderCommand.ExecutionTask is { Exception: { } exception } ) { - onError(exception); + onError(exception.InnerException ?? exception); } }; @@ -80,6 +80,10 @@ public static class RelayCommandExtensions && senderCommand.ExecutionTask is { Exception: { } exception } ) { + if (exception.InnerException != null) + { + throw exception.InnerException; + } throw exception; } };