6.6. Exercise: Errors in General 2

So far, you are given problems those require to deal with specific types of exceptions, since the functions which may raise an exception are known. However, in the most cases of programming, you will need to use the functions which you don’t know how they are implemented. So, instead of using a known type of error in your implementation, you may need a type of exception that covers all such cases.

Take a look at the exception handling in general, and generalize your solutions for the previous problems.