Aspnetcore.docs: Undocumented breaking change in IApplicationBuilder.UseExceptionHandler()

Created on 6 Jun 2018  Â·  2Comments  Â·  Source: dotnet/AspNetCore.Docs

The migration guide doesn't notice anything about UseExceptionHandler. Usage of a simple call app.UseExceptionHandler() in one's Startup.Configure will fail at runtime with the exception:
System.InvalidOperationException: 'An error occurred when configuring the exception handler middleware. Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' option must be set in 'UseExceptionHandler()'.'


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P4 Source - Docs.ms

Most helpful comment

The templates use the overload of UseExceptionHandler that takes an errorHandlingPath parm
app.UseExceptionHandler("/Error");

@Tratcher this seems like an edge case with great error message. Should this be added to doc?

All 2 comments

The templates use the overload of UseExceptionHandler that takes an errorHandlingPath parm
app.UseExceptionHandler("/Error");

@Tratcher this seems like an edge case with great error message. Should this be added to doc?

See https://github.com/aspnet/Diagnostics/issues/400. This wasn't a breaking change per-se, it didn't work before either. 2.1 added an exception to explain why it is mis-configured.

Was this page helpful?
0 / 5 - 0 ratings