16 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 (12)
ExceptionHandlerMiddlewareTest.cs (4)
58
app.UseExceptionHandler(new
ExceptionHandlerOptions
422
app.UseExceptionHandler(new
ExceptionHandlerOptions
485
app.UseExceptionHandler(new
ExceptionHandlerOptions
625
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
()
21 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);
Microsoft.AspNetCore.Diagnostics.Tests (5)
ExceptionHandlerMiddlewareTest.cs (4)
619
private IOptions<
ExceptionHandlerOptions
> CreateOptionsAccessor(
625
var
options = new ExceptionHandlerOptions()
634
var optionsAccessor = Mock.Of<IOptions<
ExceptionHandlerOptions
>>(o => o.Value == options);
640
IOptions<
ExceptionHandlerOptions
> options,
ExceptionHandlerTest.cs (1)
619
services.Configure<
ExceptionHandlerOptions
>(options =>