How to catch exceptions using customErrors?
<p>In web.config:</p>

<pre><code>&lt;customErrors mode="RemoteOnly" defaultRedirect="~/Errors.aspx"&gt;
    &lt;error statusCode="404" redirect="~/Error.aspx?code=404"/&gt;     
&lt;/customErrors&gt;
</code></pre>

<p>in page's code behind:</p>

<pre><code>throw new HttpException(404, "404 Not Found");
</code></pre>

<p>On this line, visual studio breaks with an error:</p>

<blockquote>
  <p>System.Web.HttpException was unhandled
  by user code</p>
</blockquote>

<p>Where should I catch this error?</p>
