3 instantiations of ExceptionHandlerOptions
Microsoft.AspNetCore.Diagnostics (3)
ExceptionHandler\ExceptionHandlerExtensions.cs (3)
44
return app.UseExceptionHandler(new
ExceptionHandlerOptions
62
return app.UseExceptionHandler(new
ExceptionHandlerOptions
85
return app.UseExceptionHandler(new
ExceptionHandlerOptions
16 references to ExceptionHandlerOptions
Microsoft.AspNetCore.Diagnostics (16)
ExceptionHandler\ExceptionHandledType.cs (2)
24
/// Exception was handled by by <see cref="Builder.
ExceptionHandlerOptions
.ExceptionHandler"/>.
28
/// Exception was handled by by <see cref="Builder.
ExceptionHandlerOptions
.ExceptionHandlingPath"/>.
ExceptionHandler\ExceptionHandlerExtensions.cs (3)
98
public static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app,
ExceptionHandlerOptions
options)
107
private static IApplicationBuilder SetExceptionHandlerMiddleware(IApplicationBuilder app, IOptions<
ExceptionHandlerOptions
>? options)
125
options = app.ApplicationServices.GetRequiredService<IOptions<
ExceptionHandlerOptions
>>();
ExceptionHandler\ExceptionHandlerMiddleware.cs (1)
30
IOptions<
ExceptionHandlerOptions
> options,
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (5)
25
private readonly
ExceptionHandlerOptions
_options;
36
IOptions<
ExceptionHandlerOptions
> options,
261
edi = ExceptionDispatchInfo.Capture(new InvalidOperationException($"The exception handler configured on {nameof(
ExceptionHandlerOptions
)} produced a 404 status response. " +
262
$"This {nameof(InvalidOperationException)} containing the original exception was thrown since this is often due to a misconfigured {nameof(
ExceptionHandlerOptions
.ExceptionHandlingPath)}. " +
263
$"If the exception handler is expected to return 404 status responses then set {nameof(
ExceptionHandlerOptions
.AllowStatusCode404Response)} to true.", edi.SourceException));
ExceptionHandler\ExceptionHandlerServiceCollectionExtensions.cs (5)
19
/// <param name="configureOptions">A delegate to configure the <see cref="
ExceptionHandlerOptions
"/>.</param>
21
public static IServiceCollection AddExceptionHandler(this IServiceCollection services, Action<
ExceptionHandlerOptions
> configureOptions)
33
/// <param name="configureOptions">A delegate to configure the <see cref="
ExceptionHandlerOptions
"/>.</param>
35
public static IServiceCollection AddExceptionHandler<TService>(this IServiceCollection services, Action<
ExceptionHandlerOptions
, TService> configureOptions) where TService : class
40
services.AddOptions<
ExceptionHandlerOptions
>().Configure(configureOptions);