I am calling an actionResult from my global.ascx file like so…
Response.Redirect(String.Format("~/Error/{0}/?message={1}", action, exception.Message));
What I would like to do is have the whole exception object available in the action result method so I can get and display the stack trace info on my page….Is it possible to pass along the whole exception object? What is the best way to handle this? Or is there a work around to get the proper Stack Trace info? Currently its a property that is populated correctly on the exception object.
If you redirect you can’t send complex objects. I mean you could use
SessionandTempData(which uses Session behind the scenes) but it’s ugly and something I would recommend against.If you want complex objects don’t redirect. Set proper status code and transfer which is much more RESTful and SEO friendly:
where ErrorController looks like this:
If you redirect you can’t send complex objects.