Posted by : Rhyf Ahmad Thursday, May 21, 2015

Production quality applications need to handle unexpected conditions. In .NET this is done with the structured exception syntax. When an unexpected condition arises .NET does not generate error codes. Instead when an unexpected condition occurs, the CLR creates a special object called an exception.
This object contains properties and methods that describe the unexpected condition in detail and provide various items of useful information about what went wrong. This chapter covers how structured exception handling works in Visual Basic. It discusses the common language runtime (CLR) exception handler in detail and illustrates some programming methods that are efficient when catching exceptions.
Structured exception handling is based around the idea that while exceptions should be used for unexpected conditions, they can be built within your application structure. Some older languages would allow for generic error handling that didn’t exist within a defined set of boundaries. However, professional developers learned long ago that even unexpected conditions should be definable within your application structure. To allow for this you may have what is known as a last-chance error handler at the topmost level of your application; however, most error handling is structured within individual modules. Within Visual Basic error handling depends on four keywords. Three of these are associated with properly identifying and handling exceptions, while the fourth is used when you wish to signal that an unexpected condition has occurred.

Contents:

System.Exception
Handling Exceptions
  1. Try, Catch, and Finally
  2. The Throw Keyword
  3. The Exit Try Statement
  4. Using Exception Properties

Logging Errors
  1. The Event Log
  2. Using the Trace and Debug Objects 





Ebook Preview
Get the ebook now (425 kB)

If the link above doesn't work, try the link below


Mirror: Get the ebook now (425 kB)

Leave a Reply

You can leave a comment to request any article(s), software(s), ebook(s) or report the dead link.
Then I will reply as soon as I can :)

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Recent Post

Recent Posts Widget
Instagram

- Copyright © Madriva -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -