-
Notifications
You must be signed in to change notification settings - Fork 10k
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
IExceptionHandlerFeature is not available in CustomizeProblemDetails when using UseDeveloperExceptionPage #47060
Comments
The exception handling middleware has the potential to re-execute the middleware pipeline so the Question: Is there a particular reason you are wanting to use the The only info that you can get in the |
Hi @bjornen77. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I want to be able to customize the problem details extensions property with information from the original exception. The reason is that a receiving application always should be able read the customized information in the problem details response. I know that i can create a custom exception handler also for development purposes, but it would be nice to use the built-in one. Also, it would also be more consistent(when "CustomizeProblemDetails" is called in both cases) I think that it might be easy to set the IExceptionHandlerFeature in the developer-exception-page. I could try to make a PR for it if wanted. |
@bjornen77 Thanks! A PR is definitely welcome. It helps to reuse the existing feature here. |
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
Is there an existing issue for this?
Describe the bug
The IExceptionHandlerFeature is not available in CustomizeProblemDetails when using "UseDeveloperExceptionPage". It is, however, available when using "UseExceptionHandler()". Is there a reason for this? It would be good to be able to customize the problem details also when using the DeveloperExceptionPage.
Expected Behavior
The IExceptionHandlerFeature is available when using DeveloperExceptionPage
Steps To Reproduce
Try the "/" endpoint from swagger.
Exceptions (if any)
No response
.NET Version
7.0.201
Anything else?
No response
The text was updated successfully, but these errors were encountered: