From 5436aa53bc63d0e801507709c5e95c0e0d5bf9e2 Mon Sep 17 00:00:00 2001 From: Carlos Regis <107006444+carlos-regis@users.noreply.github.com> Date: Mon, 1 Apr 2024 06:34:12 +0000 Subject: [PATCH 1/4] Add custom message to NavigationException Fixes #51787 --- src/Components/Components/src/NavigationException.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Components/Components/src/NavigationException.cs b/src/Components/Components/src/NavigationException.cs index c30bf3b59e1c..2cf7639b0832 100644 --- a/src/Components/Components/src/NavigationException.cs +++ b/src/Components/Components/src/NavigationException.cs @@ -20,4 +20,14 @@ public NavigationException(string uri) /// Gets the uri to which navigation was attempted. /// public string Location { get; } -} + + /// + /// Creates and returns a string representation of the current exception. + /// + public override string Message + { + get { + return $"Could not navigate to {Location}"; + } + } +} From b13bc4de86dcfe26047b81506099ad2851c56ce6 Mon Sep 17 00:00:00 2001 From: Carlos Regis <107006444+carlos-regis@users.noreply.github.com> Date: Mon, 1 Apr 2024 06:37:29 +0000 Subject: [PATCH 2/4] Fix Message description --- src/Components/Components/src/NavigationException.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Components/src/NavigationException.cs b/src/Components/Components/src/NavigationException.cs index 2cf7639b0832..0c766f32d16a 100644 --- a/src/Components/Components/src/NavigationException.cs +++ b/src/Components/Components/src/NavigationException.cs @@ -22,7 +22,7 @@ public NavigationException(string uri) public string Location { get; } /// - /// Creates and returns a string representation of the current exception. + /// Creates custom message. /// public override string Message { From 5732d807bb8c0f2eb0f627cf3a4520d9e1d1aff7 Mon Sep 17 00:00:00 2001 From: Carlos Regis <107006444+carlos-regis@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:24:29 +0000 Subject: [PATCH 3/4] Workaround for ci pipeline failure | error RS0016: not part of the declared API --- .../Components/src/NavigationException.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Components/Components/src/NavigationException.cs b/src/Components/Components/src/NavigationException.cs index 0c766f32d16a..e71dc6aa34e8 100644 --- a/src/Components/Components/src/NavigationException.cs +++ b/src/Components/Components/src/NavigationException.cs @@ -11,7 +11,7 @@ public class NavigationException : Exception /// /// Initializes a new instance. /// - public NavigationException(string uri) + public NavigationException(string uri) : base($"Could not navigate to {uri}") { Location = uri; } @@ -19,15 +19,5 @@ public NavigationException(string uri) /// /// Gets the uri to which navigation was attempted. /// - public string Location { get; } - - /// - /// Creates custom message. - /// - public override string Message - { - get { - return $"Could not navigate to {Location}"; - } - } + public string Location { get; } } From 6a34a63472554dbc8a5f39959decc4ea3b3e8af7 Mon Sep 17 00:00:00 2001 From: Carlos Regis <107006444+carlos-regis@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:13:03 +0000 Subject: [PATCH 4/4] Remove extra whitespaces --- src/Components/Components/src/NavigationException.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Components/src/NavigationException.cs b/src/Components/Components/src/NavigationException.cs index e71dc6aa34e8..5e0e9bd505c7 100644 --- a/src/Components/Components/src/NavigationException.cs +++ b/src/Components/Components/src/NavigationException.cs @@ -19,5 +19,5 @@ public NavigationException(string uri) : base($"Could not navigate to {uri}") /// /// Gets the uri to which navigation was attempted. /// - public string Location { get; } -} + public string Location { get; } +}