Skip to content

Make sure exceptions from OnNavigateTo are logged #62413

@ilonatommy

Description

@ilonatommy
Member

Wrap OnNavigateTo from


passed to NavigationManager's initialization here:
((IHostEnvironmentNavigationManager)navigationManager)?.Initialize(GetContextBaseUri(httpContext.Request), GetFullUri(httpContext.Request), OnNavigateTo);

in GetErrorHandledTask method, like we do for not found:
_ = GetErrorHandledTask(SetNotFoundResponseAsync(navigationManager.BaseUri, args));

because in RemoteNavigationManager we are invoking it without waiting for async-thrown exceptions:

_ = _onNavigateTo(absoluteUriString);

GetErrorHandledTask would log them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @ilonatommy

    Issue actions

      Make sure exceptions from `OnNavigateTo` are logged · Issue #62413 · dotnet/aspnetcore