Global exception handling
I think it would be helpful to describe how to access the actual Exception properties from the error page, specifically in the case of an API project.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 0e03fdf4-b19b-17c3-04f4-336ab6d2ee06
- Version Independent ID: 38515dfb-91a5-b395-db9d-084bbaf095c8
- Content: Handle errors in ASP.NET Core
- Content Source: aspnetcore/fundamentals/error-handling.md
- Product: aspnet-core
- GitHub Login: @ardalis
- Microsoft Alias: tdykstra
@markarnolditpro ... Thanks for commenting.
I'm aware we have a context for the Status Code Pages Middleware, and I'm also aware of a lambda on UseExceptionHandler that would allow one to have an app.Map or app.Use there. Unfortunately, I haven't had time to play with either of these approaches. They are documented in detail on the Net in developer blogs tho. We need to assess our coverage here and enhance what we have.
We missed a cross-link opportunity here for the ExceptionFilterAttribute ... https://docs.microsoft.com/aspnet/core/mvc/controllers/filters#exception-filters, which is the recommended the approach for custom global (almost global*) exception handling. [almost global* = see that topic for details ... it's not 100% global]
access the actual Exception properties from the error page
Yep ... that's at least worth discussing with the engineers, too.
Let's use this issue to track the work. btw- We're slammed at the moment, so this will take a little while to get to. We'll get it done tho. 🏃🏃🏃🏃
Side Note: Let's add the Exception Handling Middleware to the list when this is done. https://docs.microsoft.com/aspnet/core/fundamentals/middleware#built-in-middleware