Add detail to InvalidOperationException in Exception Handler Middleware (#22858)
This commit is contained in:
parent
fadca381b8
commit
11fb7b67d1
|
|
@ -248,7 +248,7 @@
|
|||
<value>Environment:</value>
|
||||
</data>
|
||||
<data name="ExceptionHandlerOptions_NotConfiguredCorrectly" xml:space="preserve">
|
||||
<value>An error occurred when configuring the exception handler middleware. Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' option must be set in 'UseExceptionHandler()'.</value>
|
||||
<value>An error occurred when configuring the exception handler middleware. Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' property must be set in 'UseExceptionHandler()'. Alternatively, set one of the aforementioned properties in 'Startup.ConfigureServices' as follows: 'services.Configure<ExceptionHandlerOptions>(options => { ... });'.</value>
|
||||
</data>
|
||||
<data name="ErrorPageHtml_NoRouteValues" xml:space="preserve">
|
||||
<value>No route values.</value>
|
||||
|
|
@ -280,4 +280,4 @@
|
|||
<data name="ErrorPageHtml_NameColumn" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
|
|
|||
|
|
@ -406,8 +406,9 @@ namespace Microsoft.AspNetCore.Diagnostics
|
|||
var exception = Assert.Throws<InvalidOperationException>(() => new TestServer(builder));
|
||||
|
||||
// Assert
|
||||
Assert.Equal($"An error occurred when configuring the exception handler middleware. " +
|
||||
$"Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' option must be set in 'UseExceptionHandler()'.",
|
||||
Assert.Equal("An error occurred when configuring the exception handler middleware. " +
|
||||
"Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' property must be set in 'UseExceptionHandler()'. " +
|
||||
"Alternatively, set one of the aforementioned properties in 'Startup.ConfigureServices' as follows: 'services.Configure<ExceptionHandlerOptions>(options => { ... });'.",
|
||||
exception.Message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue