Difference between IExceptionHandler and Exception Handling Middleware in ASP.NET Core

39 Views Asked by At

I'm seeking clarification on the difference between utilizing IExceptionHandler and exception handling middleware in ASP.NET Core. When I use IExceptionHandler, the handler captures the exception, but the error still appears on the console:

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request

However, when I implement exception handling middleware through a Request Delegate, no error logs are displayed on the console. I'm unsure whether this behavior is due to a misconfiguration on my part or if it's inherent to the IExceptionHandler approach. Could someone please provide insight into this issue?

0

There are 0 best solutions below