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.

29 lines
721 B

11 years ago
11 years ago
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. #if DEBUG
  9. filterContext.ExceptionHandled = false;
  10. #else
  11. filterContext.ExceptionHandled = true;
  12. #endif
  13. var e = new Elmah.Error(filterContext.Exception);
  14. Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(e);
  15. // Redirect
  16. filterContext.Result = View("Error");
  17. base.OnException(filterContext);
  18. }
  19. public ActionResult Error404()
  20. {
  21. return View();
  22. }
  23. }
  24. }