title: .NET: How to access ExceptionContext object from Exception object
body: <p>I'm writing a custom error-handling method, and am passing it an Exception object. I need to be able to access that Exception's ExceptionContext object, so I can set a property to true before I execute the Error view. Does anyone know how to get to the ExceptionContext, given just an Exception object?</p>
  
  <p>For reference, the reason I need the ExceptionContext object is so I can perform the code below:</p>
  
  <pre><code>filterContext.ExceptionHandled = true; // filterContext is of type ExceptionContext
  this.View("Error_partial", filterContext.Exception).ExecuteResult(this.ControllerContext);
  </code></pre>
  
  <p>I've read online that ExceptionHandled <em>must</em> be set to true, or the following statement will throw a yellow screen of death, rather than the friendly "Error_partial" page I'd like it to. So it's important that I be able to access the ExceptionContext of the Exception. Any help would be great appreciated.</p>