-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Update the ExceptionHandlerMiddleware to support getting the path to redirect to via LinkGenerator #4277
Copy link
Copy link
Open
Open
Update the ExceptionHandlerMiddleware to support getting the path to redirect to via LinkGenerator#4277
Feature
Copy link
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for Feature.
Today, the web app project templates have a block like this:
Note the string literal parameter in the call to
app.UseExceptionHandler. That string (in this case) is the path to a Razor Page (~/Pages/Error.cshtml), but as it's a string literal, if the page's route changes (e.g. because its name changes or another route for it is configured) this string path will now be wrong.It would be great if the middleware allowed the user to specify the path using a
LinkGenerator(expression?) such that strongly-typed paths to MVC endpoints in 2.2 (and in 3.0 any endpoint) could be done.@rynowak @JamesNK