Exceptions are responses to exceptional circumstances that can appear when a program is running. They enable the transfer of the control flow to another part of the program. Exceptions are a mechanism for simpler and more robust error handling, as opposed to returning error codes that could greatly complicate and clutter the code. In this recipe, we will look at some key aspects related to throwing and handling exceptions.
Using exceptions for error handling
Getting ready
I assume you have basic knowledge of the mechanism of throwing and catching exceptions.
How to do it...
Use the following practices to...