In our programs, we resort to error handling procedures for situations that we anticipate as prone to cause errors. This is usually the case for data input.
The idea behind error handling is to gracefully respond to these expected errors in an attempt to either continue our program execution or decide to fail if the error turns out to be insurmountable.
There are different approaches by which we can handle errors on our programs, but not all of them are always applicable. Some of these approaches are as follows:
- Value substitution
- Error logging
- Exception handling