12.7. Exception Properties
As we discussed in Section 12.5, exception types derive from class Exception, which has several properties. These frequently are used in error messages indicating a caught exception. Two important properties are Message and StackTrace.
Property Message stores the error message associated with an Exception object. This message can be a default message associated with the exception type or a customized message passed to an Exception object’s constructor when the Exception object is thrown.
Property StackTrace contains a (normally lengthy) String that represents the method-call stack. Recall that the runtime environment at all times keeps a list of open method calls that have been made but have not yet returned. The
Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.