Tip: Gracefully handle exceptions by introducing the same exception

When you write a reasonably large application then you will get exceptions. One source of information about these problems are diagnostic log files. However, just because you can see that an exception has been reported it is not always obvious what state the wider system was in to trigger the problem. This presents two problems; 1) What caused the problem 2) How to gracefully handle the exception. My tip here concerns the latter, how can we be sure that any new code we introduce correctly handles the problem if we are not sure how to…