0

This page talks about error handling for ASP.NET Core apps. But it is focused on pages and responses. I have a slightly different need.

I need to be very sure that if there are unhanded errors, that I log them. (Right now my service is failing under a load test with no indication in the logs as to why or where.)

With all the Tasks being called, I am guessing that there are some lost exceptions in the mix.

Is there an "unhanded exceptions" call back for ASP.NET Core (v3.1)? (So I can log the exception.)

Vaccano
  • 78,325
  • 149
  • 468
  • 850

1 Answers1

0

You can create an Exception Filter. See this documentation: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-3.1#exception-filters

Tony Troeff
  • 338
  • 4
  • 19