I have a ActionFilterAttribute like that
public class DataModelAttribute : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
...
throw filterContext.Exception; //StackTrace is fine (pointing to my controller)
}
}
I have a global error filter like that:
public class OncHandleErrorAttribute : HandleErrorAttribute
{
public override void OnException(ExceptionContext context)
{
var ex = context.Exception; //Here StackTrace points to DataModelAttribute file
}
}
So I lost my original StackTrace ... How can I preserve that ?