AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Global exception handling

Open markarnolditpro opened this issue 8 years ago • 1 comments

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.

markarnolditpro avatar Jul 10 '18 12:07 markarnolditpro

@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

guardrex avatar Jul 10 '18 13:07 guardrex