1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Teknik.Areas.Error.ViewModels;
- using Teknik.Controllers;
-
- namespace Teknik.Areas.Error.Controllers
- {
- public class ErrorController : DefaultController
- {
- [AllowAnonymous]
- public ActionResult Exception(Exception exception)
- {
- ViewBag.Title = "Exception - " + Config.Title;
- ViewBag.Description = "Just a boring 'ol exception. Nothing to see here, move along.";
-
- if (Response != null)
- Response.StatusCode = 200;
-
- ErrorViewModel model = new ErrorViewModel();
- model.Exception = exception;
-
- return View(model);
- }
-
- [AllowAnonymous]
- public ActionResult General(Exception exception)
- {
- ViewBag.Title = "Http Exception - " + Config.Title;
- ViewBag.Description = "There has been a Http exception. Run!";
-
- ErrorViewModel model = new ErrorViewModel();
- model.Description = exception.Message;
- model.Exception = exception;
-
- return View(model);
- }
-
- [AllowAnonymous]
- public ActionResult Http403(Exception exception)
- {
- ViewBag.Title = "403 - " + Config.Title;
- ViewBag.Description = "Access Denied";
-
- ErrorViewModel model = new ErrorViewModel();
- model.Exception = exception;
-
- return View(model);
- }
-
- [AllowAnonymous]
- public ActionResult Http404(Exception exception)
- {
- ViewBag.Title = "404 - " + Config.Title;
- ViewBag.Description = "Uh Oh, can't find it!";
-
- ErrorViewModel model = new ErrorViewModel();
- model.Exception = exception;
-
- return View(model);
- }
-
- [AllowAnonymous]
- public ActionResult Http500(Exception exception)
- {
- ViewBag.Title = "500 - " + Config.Title;
- ViewBag.Description = "Something Borked";
-
- ErrorViewModel model = new ErrorViewModel();
- model.Exception = exception;
-
- return View(model);
- }
- }
- }
|