Skip to content

Commit bf46877

Browse files
committed
Introduce routes for ErrorController
With the introduction of the new `ErrorController` (e7fe64f), I'm adding the new `MapTopicErrors()` route (4796340), as well as a standard `MapTopicRoute()` for the `Error` root. The `MapTopicErrors()` configuration will allow routing to `/Error/{statusCode}`, as used by e.g. `UseStatusCodePages()`, while the `MapTopicRoute()` configuration will allow routing to arbitrary pages under `Error`, such as e.g. `/Error/Unauthorized/`.
1 parent e52409f commit bf46877

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
/*------------------------------------------------------------------------------------------------------------------------------
7070
| Configure: MVC
7171
\-----------------------------------------------------------------------------------------------------------------------------*/
72+
app.MapTopicErrors("Error");
73+
app.MapDefaultControllerRoute();
7274
app.MapTopicRoute("Web");
75+
app.MapTopicRoute("Error");
7376
app.MapTopicSitemap();
7477
app.MapTopicRedirect();
7578
app.MapControllers();

0 commit comments

Comments
 (0)