Return the path in error handling #35596
Labels
area-middleware
Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Needs: Attention 👋
This issue needs the attention of a contributor, typically because the OP has provided an update.
I handle the errors very well throughout the project as described in this section of the document. Personally, I prefer just one controller for errors.
Startup.cs
ErrorController
It returns the HTTP status code with
status
variable , but I want to return the previous request path as well. I was writing a new middleware from theUseStatusCodePagesWithRedirects
extension, but the controller cannot catch the error because I changed the original pattern to another one. eg.code={0}&path={1}
. I try different features inHttpContext
but they only return status code normally. To put it simply, I want to handle referrer uri to the error controller.Feature Request
It should be one more query string named for example
path
or something else and it shuold returns the previous uri in theUseStatusCodePagesWithRedirects
extension.Should be
In this way, the path can handle in the controller as follows.
The text was updated successfully, but these errors were encountered: