Skip to content

Commit 285f843

Browse files
Copilotilonatommy
andauthored
Wrap OnNavigateTo callback with GetErrorHandledTask for proper exception logging (#62414)
* Initial plan for issue * Wrap `OnNavigateTo` callback with `GetErrorHandledTask` for proper exception logging --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ilonatommy <32700855+ilonatommy@users.noreply.github.com> Co-authored-by: Ilona Tomkowicz <itomkowicz@microsoft.com>
1 parent 6ab0f4e commit 285f843

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ internal async Task InitializeStandardComponentServicesAsync(
8484
IFormCollection? form = null)
8585
{
8686
var navigationManager = httpContext.RequestServices.GetRequiredService<NavigationManager>();
87-
((IHostEnvironmentNavigationManager)navigationManager)?.Initialize(GetContextBaseUri(httpContext.Request), GetFullUri(httpContext.Request), OnNavigateTo);
87+
((IHostEnvironmentNavigationManager)navigationManager)?.Initialize(
88+
GetContextBaseUri(httpContext.Request),
89+
GetFullUri(httpContext.Request),
90+
uri => GetErrorHandledTask(OnNavigateTo(uri)));
8891

8992
navigationManager?.OnNotFound += (sender, args) => NotFoundEventArgs = args;
9093

0 commit comments

Comments
 (0)