-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set exception handler feature in developer exception page #47554
Set exception handler feature in developer exception page #47554
Conversation
When using the developer exception page, the exception handler feature is now set before invoking the problem details service. This makes it possible to get the original exception when using the problem details service if wanted. Fixes dotnet#47060
Thanks for your PR, @bjornen77. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddlewareImpl.cs
Outdated
Show resolved
Hide resolved
This is ok, but have we considered adding the exception to the problem details context? public class ProblemDetailsContext
{
public Exception? Exception { get; init; }
} When the problem details context is written from one of the exception handler middleware, the exception would be set on the context. Getting the exception from a feature is a semi-advanced concept. Having it available on the problem details context would be more straightforward. |
I do not know if adding the exception to the context has been discussed, but I think it would be a good thing to do. Should we keep this change just to make the different exception handlers behave the same? |
FWIW, I don't think getting it from the feature is that advanced. If anything, it has a bit of an edge over the
I think we should go with this change because adding the
Would you be interested in submitting an API proposal for this via the template? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given that I believe having the feature on the ProblemDetailsContext
should happen in addition to this change.
Sure, no problem! |
When using the developer exception page, the exception handler
feature is now set before invoking the problem details service.
This makes it possible to get the original exception when using
the problem details service if wanted.
Fixes# #47060