title: Can the ASP.NET MVC Yellow Screen of Death (YSOD) be generated on demand
body: <p>As asked <a href="https://stackoverflow.com/questions/878628/can-the-asp-net-yellow-screen-of-death-ysod-be-generated-on-demand-or-captured">here</a>. </p>
  
  <p>I want to know if it is possible to get the YSOD's HTML Rendering for exceptions to be sent by mail WITHOUT the use of ELMAH?  I am handling the errors and showing a custom error page to the user. I am also sending the exception general information throught mail, however I really would like to know if I can wrap them into the real built-in YSOD engine of ASP.NET and keep the HTML formatting.</p>
  
  <p><strong>UPDATE1:</strong></p>
  
  <p>I have my custom exceptions (DupplicatedArbsException) that returns a view with the message which i consider "Managed Exceptions". However, if it is a real error that I did not catch, it will return the Error view.</p>
  
  <pre><code>    [HandleError(ExceptionType = typeof(Exception), View = "Error")]
      [HandleError(ExceptionType = typeof(DuplicatedArbsException), View = "ErrorViewArbs")]
      public ActionResult Create(string id, int? version)
      {
           //...
      }
  </code></pre>
  
  <p>The HandleError Raises which does nothing currently.</p>
  
  <pre><code>    protected override void OnException(ExceptionContext filterContext)
      {
          var ex = filterContext.Exception;
          base.OnException(filterContext);
      }
  </code></pre>
  
  <p>..</p>
  
  <pre><code>    &lt;customErrors mode="On" defaultRedirect="Error"/&gt;
  </code></pre>
  
  <p>The exception raised in customErrors mode="off" is the YSOD from asp.net. However, when I turn customErrors mode="on" those exceptions are not wrapped in it's html equivalent but only the exception messages (no html at all).</p>