谁能告诉我,如何在 MVC 5 中使用 Elmah .. 发生错误时,它必须重定向到某个默认页面,例如服务错误,找不到 Http。
public ActionResult About()
{
ViewBag.Message = "Your app description page.";
try
{
int message = Convert.ToInt32("Hello");
}
catch (Exception exp)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(exp);
// throw;
}
return View();
}
我如何重定向到错误页面