The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.
 
 
 
 
 

83 lines
2.3 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Error.ViewModels;
using Teknik.Controllers;
using Teknik.Filters;
namespace Teknik.Areas.Error.Controllers
{
public class ErrorController : DefaultController
{
[TrackPageView]
[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);
}
[TrackPageView]
[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);
}
[TrackPageView]
[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);
}
[TrackPageView]
[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);
}
[TrackPageView]
[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);
}
}
}