title: httpErrors errorMode = "Detailed" only for a specific error code
body: <p>I have an asp.net MVC3 application. In my controller I have an ajax action that sets custom response code using Response.StatusCode = 600. I need to pass through the response as is without the IIS trying to look for the custom error page. I tried to use the following code to let IIS not use its custom page for response status of 600. </p>
  
  <pre><code>&lt;!-- Pass through Ajax Errors with status code 600 --&gt;
    &lt;httpErrors errorMode="Detailed" existingResponse="PassThrough"&gt;
        &lt;error statusCode="600" path="/" /&gt;
    &lt;/httpErrors&gt;
  &lt;!--End --&gt;
  </code></pre>
  
  <p>The problem with the above snippet is that this applies to all the response codes so even if the Code fails with 500 Internal Server, the response passes through as is without IIS interfering. This exposes my internal Controller and View code to the user (if by chance some exception occurs that I have not handled). </p>
  
  <p>So, how do I configure web.config to pass through detailed response only when response.statuscode is 600 (custom) and provide the default IIS custom pages for other errors (for example Internal Server Error 500).</p>