Exception filters are an MVC concept, and since unhandled exceptions can occur even outside of MVC, using ExceptionFilters may not be enough.
, , ExceptionHandlerMiddleware. . : app.UseExceptionHandler(errorHandlingPath: "/Home/Error");
Error . , :
var exceptionHandlerFeature = HttpContext.Features.Get<IExceptionHandlerFeature>();
var exception = exceptionHandlerFeature.Error;
, , , . , , .
exceptionContext.ExceptionHandled = true;