Iexceptionhandler3 (#29691)

* Add IExceptionHandler to WN

* Update aspnetcore-8.0.md
pull/29689/head
Tom Dykstra 2023-06-30 15:26:08 -07:00 committed by GitHub
parent 53e763d859
commit 3d3695115e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -4,7 +4,7 @@ author: rick-anderson
description: Learn about the new features in ASP.NET Core 8.0.
ms.author: riande
ms.custom: mvc
ms.date: 06/27/2023
ms.date: 06/30/2023
uid: aspnetcore-8
---
# What's new in ASP.NET Core 8.0
@ -468,6 +468,14 @@ Metrics offers a number of improvements compared to existing event counters:
Metrics have been added for ASP.NET Core hosting, Kestrel, and SignalR. For more information, see [System.Diagnostics.Metrics](/dotnet/core/diagnostics/compare-metric-apis#systemdiagnosticsmetrics).
### IExceptionHandler
[IExceptionHandler](https://source.dot.net/#Microsoft.AspNetCore.Diagnostics/ExceptionHandler/IExceptionHandler.cs,adae2915ad0c6dc5) is a new interface that gives the developer a callback for handling known exceptions in a central location.
`IExceptionHandler` implementations are registered by calling [`IServiceCollection.AddExceptionHandler<T>`](https://source.dot.net/#Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerServiceCollectionExtensions.cs,e74aac24e3e2cbc9). Multiple implementations can be added, and they're called in the order registered. If an exception handler handles a request, it can return `true` to stop processing. If an exception isn't handled by any exception handler, then control falls back to the default behavior and options from the middleware.
For more information, see [IExceptionHandler](xref:fundamentals/error-handling#iexceptionhandler).
<!--
## API controllers