Developer forum

Forum » Development » Module error message

Module error message


Reply
 
When a module throws an unhandled exception the output of the module is:
 
“An error occured while attaching module (Dynamicweb.Frontend.Content)”
Followed by the stacktrace.
 
 
This is not ideal, when using custom error pages and handling
 
Is it possible to avoid this?

/Thomas

Replies

 
Reply
Hi Thomas,

You can wrap you module's code in a try/catch block and do whatever you see fit in the catch block, such as logging the exception and returning a user friendly error message.

Cheers,

Imar
 
Reply
Hi Imar,
 
Thanks for your reply, I’m aware of this possibility, but that way the Exception will never reach  my generic errorhandler added to the Application_Error in Global.asax.
 
And if a DynamicWeb module generates the exception, there is nothing I can do.
 
So maybe  I need to make a feature request for a OnModuleError notification

Best regards,

Thomas
 
 
Reply
I see. Yes, OnModuleException or something like that would indeed be useful.

Cheers,

Imar

 

You must be logged in to post in the forum