Skip to content

Commit 5140a7e

Browse files
committed
Updated UseExceptionHandler() to use the new ErrorController
With the introduction of the `ErrorController` (e7fe64f, bf46877), we now have a valid target for the `UseExceptionHandler()` call. Previously, this pointed to a non-existent page. This was fine for sample purposes, but now that we have an actual page to us, this is preferred. This could alternatively point to any arbitrary `Topic` under `Error` (e.g., `Error:InternalServer`).
1 parent 8ab1d77 commit 5140a7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
app.UseDeveloperExceptionPage();
5353
}
5454
else {
55-
app.UseExceptionHandler("/Home/Error");
5655
app.UseStatusCodePagesWithReExecute("/Error/{0}");
56+
app.UseExceptionHandler("/Error/500/");
5757
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
5858
app.UseHsts();
5959
}

0 commit comments

Comments
 (0)