Method AddApiExceptionHandler
AddApiExceptionHandler(IServiceCollection)
Registers the default ApiExceptionHandler, which reports API exceptions as-is and logs unexpected exceptions with a reference ID that is
reported to the client (or propagates them in development environments).
Declaration
public static IServiceCollection AddApiExceptionHandler(this IServiceCollection services)
Parameters
Returns
AddApiExceptionHandler<THandler>(IServiceCollection)
Registers an IApiExceptionHandler that maps exceptions thrown during request processing to the errors reported to clients. Derive from
ApiExceptionHandler to customize the default behavior with application-specific exception mappings.
Declaration
public static IServiceCollection AddApiExceptionHandler<THandler>(this IServiceCollection services) where THandler : class, IApiExceptionHandler
Parameters
Returns
Type Parameters
| Name |
Description |
| THandler |
The handler type.
|