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
The section about IExceptionHandler is misleading. #32311
Comments
I'd also mention that currently There was a request to disable logging but dev team rejected the proposal. But this is so wrong regarding the expectations of the developer. Kestrel logs uncaught (!) exceptions with However, It's better to clarify in documentation, how to disable logging error from the middleware:
|
I'd propose @adityamandaleeka to reconsider. |
Description
The article creates an impression that it's enough to add custom implementation of
IExceptionHandler
. However, I had to callUseExceptionHanlder
middleware.This comment is a confirmation that the former does not work without the latter.
However, there are more surprises:
If I call:
I get the following exception:
If I call it like this:
custom exception handler is called, but I see two log entries about the errordespite by handler returns
true
:and then from my handler:
I'd appreciate if this WTF behavior was properly explained.
Why do I need to call it, if I called
builder.Services.AddExceptionHandler<ExceptionHandler>();
Here's the code I use:
Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/error-handling.md
Document ID
38515dfb-91a5-b395-db9d-084bbaf095c8
Article author
@tdykstra
The text was updated successfully, but these errors were encountered: