title: How can I provide a HandleErrorInfo model with an object?
body: <p>I'm writting an ASP.NET MVC app and I encountered following problem. I want to make custom error pages with detailed information about the errors (such as error message or what controller caused the error), but I can't provide the model on the view with an HandleErrorInfo object. </p>
  
  <p>At first I configured the Web.config file to handle custom errors:</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~/Error"&gt;
    &lt;error statusCode="404" redirect="~/Error/NotFound"/&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>Then I created the Error Controller to manage the error views:</p>
  
  <pre><code>public class ErrorController : Controller
  {
      public ActionResult Index()
      {
          return View("Error");
      }
  
      public ViewResult NotFound()
      {
          Response.StatusCode = 404;
          return View("NotFound");
      }
  }
  </code></pre>
  
  <p>And on the View I added the model type:</p>
  
  <pre><code>@model System.Web.Mvc.HandleErrorInfo
  </code></pre>
  
  <p>But the model is null everytime and I don't know how to pass the right object with error details to the view and where this object should be created. Can you help me? Is it even possible to do it this way?</p>