title: ASP.NET MVC 3. Avoid generating 'System.Web.HttpException', in calls to partial views
body: <p>I have a filter for exceptions <code>ExceptionHandlingAttribute</code>:</p>
  
  <pre><code>public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  {
        filters.Add(new ExceptionHandlingAttribute());
  }
  </code></pre>
  
  <p>When an exception occurs we do a log by policies <code>exceptionHandling / exceptionPolicies</code> in our <code>web.config</code> and we replace the exception by a generic exception for the client and it is directed to <code>Error.cshtml</code>.</p>
  
  <p>But when a business exception occurs <code>BusinessException</code>, the message of the exception is shown directly without log and without replace.</p>
  
  <p>My problem is as follows, When generating an exception <code>BusinessException</code> in a partial view, and we call it by <code>Html.RenderAction</code>, It also generates the exception <code>System.Web.HttpException</code>. The last exception <code>System.Web.HttpException</code> is replaced, registered, and I can not show the exception <code>BusinessException</code>.</p>
  
  <p>How can I for which to generate the exception <code>BusinessException</code>, will send directly to <code>Error.cshtml</code> and the <code>System.Web.HttpException</code> exception is not generated in the view that calls the partial view?</p>
  
  <p>Thank you.</p>