title: Custom error page isn't shown when exception thrown
body: <p>I have setup a custom error handler to show diagnostic information to a user if a crash occurs. The problem is the custom error page is not shown and I get an exception (according to the webpage) thrown whilst trying to show the error page.  I cannot figure out what is causing it though?  I have similar pages set up for 500 and 404 errors which work fine.</p>
  
  <p>The error page says <code>Server Error in '/' Application.</code></p>
  
  <blockquote>
    <p>Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated. </p>
  </blockquote>
  
  <p>Ill show snippets of my setup, if anyone wants to see more please ask.  FYI I am throwing the exception by removing the connection string details from my <code>web.config</code> (its an actual error we are seeing during deployment so I want to target this specifically)</p>
  
  <pre><code>&lt;system.webServer&gt;
    &lt;httpErrors errorMode="Custom"&gt;
      &lt;remove statusCode="404" /&gt;
      &lt;error statusCode="404" path="/error/notfound" responseMode="ExecuteURL" /&gt;
      &lt;remove statusCode="403" /&gt;
      &lt;error statusCode="403" path="/error/forbidden" responseMode="ExecuteURL" /&gt;
      &lt;remove statusCode="500" /&gt;
      &lt;error statusCode="500" path="/error/" responseMode="ExecuteURL" /&gt;
    &lt;/httpErrors&gt;
  &lt;/system.webServer&gt;
  
  &lt;!-- .... --&gt;
  
  &lt;system.web&gt;
    &lt;customErrors mode="On" defaultRedirect="~/Error" redirectMode="ResponseRewrite"&gt;
      &lt;error redirect="~/Error/NotFound" statusCode="404" /&gt;
      &lt;error redirect="~/Error/Forbidden" statusCode="403"  /&gt;
      &lt;error redirect="~/Error/" statusCode="500"  /&gt;
    &lt;/customErrors&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>I then have an ErrorController with a default <code>Index()</code> function (no breakpoint within this controller gets hit)</p>
  
  <pre><code>public ViewResult Index()
  {
      return View("Error");
  }
  </code></pre>
  
  <p><strong>Note:</strong> I have functions for <code>Forbidden()</code> and <code>NotFound()</code> - I just didnt copy them here - these errors work perfectly fine.</p>