I'm currently using ASP.NET Core, how do I set a 404 default page for unhandled exceptions or NotFound()
?
IActionResult Foo()
{
throw new Exception("Message!");
}
IActionResult Bar()
{
return NotFound("Message!");
}
I think there is a IApplicationBuilder.UseExceptionHandler
method to set an error page, but I don't know how to configure it.