Hi,
I spent all day on this and I haven’t yet been able to figure it out. I'm trying to simply institute a "global" solution across my DNN application to handle exceptions. Using vanilla asp.net, i have multiple options, including overriding OnError, as well as Page_Error, and also modifying global.asax.vb using the application_error override. I've tried all of these to no avail.
Basically, I think something in DNN is intercepting the exception before it bubbles up to application_error, so that never gets called. Also, OnError is a page-level error handler, so putting it inside of UserControls (which is what my modules are) seems to have no effect. Finally, Page_Error seemed to do something (when I wire up the Page.Error event to it), but when I used that, it seemed to just return a blank page as the result, and not just fail out the single module.
It’s kinda strange that i cannot find any examples or good documentation for this. The last document I can find is http://seagrant.wisc.edu/CoastalHazar...
It nicely states what we’re trying to do under “ideal solution” – “all successfully rendered modules to display normally, and failed modules should be replaced with an error message. The Error message should be displayed in the exact location that the module would have displayed.”
However, this document is for DNN v2.0, and from what I can tell, they don’t seem to do it this way anymore, as when I add this code and config, it doesn’t seem to work. In fact, the doc says the config is “already added to the dnn 2.0 or greater web.config file” and this is not the case in our v5.6 deployment. So, they seemed to deprecate this, but I’m not sure what replaces it.
So, I’m kinda frustrated at this point… been spinning wheels all day with various solutions that don’t work because I can’t really find any documentation that tells me EXACTLY what dotnetnuke does by default when an exception occurs (so i can work around it). It seems like ANY of these solutions would work for a regular asp.net app, but DNN is trying to be helpful somewhere but there’s no documentation to say exactly how it is being “helpful.”
Another approach might be to skip trying to do “global” exception handling and try to fit in a bunch of try/catches in our parent implementation of UserControl that all hte modules utilize; however, I think there is still potential for exceptions inside of the various grid event handlers/etc… So I think that a global solution is definitely needed.
Any help, links, or suggestions would be greatly appreciated,
russ