Summary
This chapter reviewed the Exception object and the syntax available to work with exceptions. You have looked at the various properties of exceptions and learned how to use the exposed information. You have also seen how to promote exceptions to consuming code using the Throw statement.
The chapter also covered writing to Event Logs to capture information about generated exceptions. Event Logs require elevated permissions, and you should use Event Logs judiciously to avoid overloading them.
Regardless of how you capture errors, having information about exceptions captured for after-the-face analysis is an invaluable tool for diagnosis.
The chapter covered a simple technique for generating trace output for programs. By using the full capabilities for exception handling and error logging that are available in Visual Basic, you can make your applications more reliable, and diagnose problems faster when they do occur.
Now that you've covered the core elements of working in Visual Basic, you will shift to the data section. This section starts with memory data like arrays, lists, and dictionaries and then moves on to working with file and database storage.
Get Professional Visual Basic 2012 and .NET 4.5 Programming 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.