Hello all,
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?
For reference, the reason I need the ExceptionContext object is so I can perform the code below:
filterContext.ExceptionHandled = true; // filterContext is of type ExceptionContext
this.View("Error_partial", filterContext.Exception).ExecuteResult(this.ControllerContext);
I've read online that ExceptionHandled must 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.
Thanks.