15 instantiations of ExceptionHandlerOptions
ExceptionHandlerSample (1)
StartupWithProblemDetails.cs (1)
30
throwApp.UseExceptionHandler(new
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
Microsoft.AspNetCore.Diagnostics.Tests (11)
ExceptionHandlerMiddlewareTest.cs (3)
320
app.UseExceptionHandler(new
ExceptionHandlerOptions
383
app.UseExceptionHandler(new
ExceptionHandlerOptions
496
var options = new
ExceptionHandlerOptions
()
ExceptionHandlerTest.cs (8)
670
app.UseExceptionHandler(new
ExceptionHandlerOptions
705
app.UseExceptionHandler(new
ExceptionHandlerOptions
850
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
956
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
1008
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
1063
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
1078
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
1141
app.UseExceptionHandler(new
ExceptionHandlerOptions
()
19 references to ExceptionHandlerOptions
Microsoft.AspNetCore.Diagnostics (14)
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,
217
edi = ExceptionDispatchInfo.Capture(new InvalidOperationException($"The exception handler configured on {nameof(
ExceptionHandlerOptions
)} produced a 404 status response. " +
218
$"This {nameof(InvalidOperationException)} containing the original exception was thrown since this is often due to a misconfigured {nameof(
ExceptionHandlerOptions
.ExceptionHandlingPath)}. " +
219
$"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);
Microsoft.AspNetCore.Diagnostics.Tests (5)
ExceptionHandlerMiddlewareTest.cs (4)
491
private IOptions<
ExceptionHandlerOptions
> CreateOptionsAccessor(
496
var
options = new ExceptionHandlerOptions()
501
var optionsAccessor = Mock.Of<IOptions<
ExceptionHandlerOptions
>>(o => o.Value == options);
507
IOptions<
ExceptionHandlerOptions
> options,
ExceptionHandlerTest.cs (1)
619
services.Configure<
ExceptionHandlerOptions
>(options =>