You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
610 B

11 years ago
  1. using System.Web.Mvc;
  2. namespace Sevomin.WebFrontend.Controllers
  3. {
  4. public class BaseController : Controller
  5. {
  6. protected override void OnException(ExceptionContext filterContext)
  7. {
  8. filterContext.ExceptionHandled = true;
  9. var e = new Elmah.Error(filterContext.Exception);
  10. Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(e);
  11. // Redirect
  12. filterContext.Result = View("Error");
  13. base.OnException(filterContext);
  14. }
  15. public ActionResult Error404()
  16. {
  17. return View();
  18. }
  19. }
  20. }