How can I pass exceptions to my custom error page and present them the same way you can on the standard error page you get when you first create a new application? The code below works on the standard error page but not on my custom. Any ideas?
@model System.Web.Mvc.HandleErrorInfo
@{
ViewBag.Title = "Error";
}
<h1 class="error">Error.</h1>
<h2 class="error">An error occurred while processing your request.</h2>
@if (Model != null)
{
@Model.Exception.Message
@Model.Exception.InnerException
}