Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Global Exception Handling in DNN 5.6Global Exception Handling in DNN 5.6
Previous
 
Next
New Post
1/18/2011 5:59 PM
 

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

 
New Post
1/19/2011 12:22 PM
 
DNN has built in handling processes, what are you trying to do to handle errors?  Are you trying to capture a specific set of errors?

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
1/20/2011 11:07 AM
 
i came up with a solution. Instead of having my controls inherit from UserModule, they inherit from a class which has a single method called ProcessException(Exception ex) { which calls DNN's Exceptions.ProcessModuleLoadException(this, exc), removes all child controls on the instance, and then injects a literal control based off of my configuration to either write the stack trace on the spot of the module or else put a friendly error message on the spot.

In my implementing class, most methods include a try { ... } catch { Exceptions.ProcessException(exc); }  This satisfies the requirements of the whitepaper i referenced above in bold, and doesn't use enterprise library or anything like that.

In summary, the exception handling is the try/catch blocks. the exception processing is centralized.
 
New Post
1/24/2011 11:29 AM
 
yuck, my solution totally failed when an exception occurs within Telerik _NeedDataSource methods. Everything from "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases." to other times when the ProcessModuleLoadException method throws a ThreadAbort exception. And, sometimes, when an exception occurs, the thing ends up going into an infinite loop and re-calling _NeedsDataSource and failing over and over.

Back to the drawing board. What are other people doing for exception handling within telerik controls' _NeedDataSource methods? Or general exception handling for DNN (back to my original post)? I've seen some examples online with catch statements that do nothing, but obviously that's not a solid solution. Another option is to bypass _NeedDataSource and use simple data binding, but that seems like a workaround as well.

Again, back to the original whitepaper, all i'm trying to do is when an error occurs somewhere, “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.” This shouldn't be so painful, but alas.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Global Exception Handling in DNN 5.6Global Exception Handling in DNN 5.6


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out