ChapterÂ 3.Â Error Handling
Errors are a fact of life. Mr. Murphy has an entire collection of laws detailing the prevalence and inescapability of errors. In programming, errors come in two basic flavors:
External errorsâ.Â These are errors in which the code takes an unanticipated path due to a part of the program not acting as anticipated. For example, a database connection failing to be established when the code requires it to be established successfully is an external error.
Code logic errorsâ.Â These errors, commonly referred to as bugs, are errors in which the code design is fundamentally flawed due to either faulty logic (âit just doesnât work that wayâ) or something as simple as a typo.
These two categories of errors differ significantly ...