title: How can I see/use/log the exception when "customErrors mode="On""?
body: <p>I have this in my <code>web.config</code>:</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~\Error" &gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>And a simple ErrorController:</p>
  
  <pre><code>public class ErrorController : Controller
  {
    public ViewResult Index()
    {
      return View("Error");
    }
  }
  </code></pre>
  
  <p>What I want to do is to log the error to some file, before returning the <code>Error</code> view. However I cannot seem to find an example on how to access the thrown exception inside my controller. Any help appreciated.</p>