A function which detects an error can throw an exception.
A function which can deal with errors can catch
an exception.
When an exception is thrown, control "travels" up the call stack, "looking" for a function that can catch it.
If none is found, some default behavior is invoked (typically termination).
|
|