Exception handling with status code redirects
app.UseStatusCodePagesWithRedirects("/home/error/{0}");
app.UseExceptionHandler("/home/error");
[Route("home/error/{code?}")]
public IActionResult Error(int code=0)
{
return View(code);
}
<body>
@Model
</body>