Exception Handling

Handle WPF Application Exceptions all in one Place

Learn how to handle all of the exceptions from your WPF applications in one place. Avoid writing Try/Catch blocks everywhere in your code unless you really need them. Please note: You would still continue to write Try/Catch Blocks around your logical piece of code, to catch specific exceptions such as

Improved JavaScript Error Handling

To supress JavaScript error messages, simply place this snippet in the Head section of your Web page: &ltSCRIPT language=”JavaScript”&gtfunction dontshowerrormessages() {return true;}window.onerror=dontshowerrormessages; An even better method is to use the following code: function betterhandler(description,pagename,lineno){ alert( ‘An Error occurred! ‘ +’ Description: ‘+description +’ Page Name: ‘+pagename +’ At Line :

Causes for an InstantiationException

Question: What can cause an InstantiationException? Answer: An InstantiationException is thrown when you try to create an instance of a class with Class.newInstance() and the class cannot beinstantiated. This could be because there is an uninstantiable interface or abstract class. If the constructor is not public, thenan IllegalAccessException will be