dotnet/aspnetcore

NavigationException doesn't have a useful message.

开放

#51,787 创建于 2023年10月31日

 (10 条评论) (0 个反应) (0 位负责人)C# (10,653 个派生)batch import
area-blazorenhancementfeature-blazor-navigationhelp wanted

仓库指标

星标
 (37,933 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

this https://github.com/dotnet/aspnetcore/blob/d8a3aa870862d01a8b3a3235f8dd7fc951dd8ff4/src/Components/Server/src/Circuits/RemoteNavigationManager.cs#L91

creates an exception like this image with the URL in the Location field.

Ideally it should have a useful message that includes the URI, eg., "Could not navigate to https://localhost:7298/item/99"

the problem is that NavigationException is not overriding Message and ToString https://github.com/dotnet/aspnetcore/blob/d8a3aa870862d01a8b3a3235f8dd7fc951dd8ff4/src/Components/Components/src/NavigationException.cs#L9

If we want to keep the URL out of the message for security reasons, it should at least have a message like "Could not navigate to the URL".

贡献者指南