Home | Sign Up Free | Submit Articles | About Us | Link to Us | Contact Us | Privacy Policy | Terms of Service

Error Handling

By: Chris Kemp

For years, the weak part of most of the languages supported by Microsoft has been the error handling capability. In most cases this error handling was a variant of 2 statements:

On Error Goto; and

On Error Resume Next

Which resulted in branching to an End statement, or continuing on as if nothing had happened.

Taking a page from the Java model, Microsoft, in order to achieve cross platform uniformity with all of the .Net languages, has adopted the

Try..Catch..Finally..End Try method of handling errors. This allows an error to be handled in the routine in which it occurs. If the exception is not caught, it is referred to the calling procedure, and so on and so on. If no exception is caught by the end of the calling chain, the user is notified by a dialog box.

Exception objects have 4 properties in common. The Message property is the text which describes the error. It is similar to the old Err.description. StackTrace returns a string which traces the path from where the exception was originally thrown. The Source property return s the name of the routine where the exception was thrown. This is analogous to Err.Source. HelpLink returns the URL or URN to the helpfile associated with the error.



Article Source: http://addondashboard.com -- Free Articles, Free Web Content

Chris is well known author who writes about IT consultant, .Net programming and custom programming. For more information visit www.paladn.com

Please Rate this Article

 

Not yet Rated

Click the XML Icon Above to Receive Information Technology Articles Via RSS!



Copyright © 2007 AddonDashboard: Free Online Article Directory
Privacy Policy | Terms of Service

Powered by Article Dashboard