Does the .NET 8 IExceptionHandler support middleware pipeline re-execute? #52096
Unanswered
seangwright
asked this question in
Q&A
Replies: 1 comment
-
@seangwright With
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The previous ASP.NET Core exception handling approach supported re-executing the middleware pipeline based on the provided path.
This would set the request path to the new path and run the middleware pipeline again.
The benefit here is that an "error handled response" could be rendered via Controller, Razor Page, API endpoint.
Unfortunately this path was hardcoded, which mean you couldn't pick different paths at runtime based on the request context.
With
IExceptionHandler
, you can inspect theHttpContext
but it isn't clear to me if its possible for the implementations to cause a pipeline re-execution. There aren't any docs on this feature yet, so I've been reviewing the source code.Ideally, I'd like to be able to dynamically specify the path to re-execute based on the
Exception
using anIExceptionHandler
implementation.Beta Was this translation helpful? Give feedback.
All reactions