Friday, June 19, 2009

Exception Handling Techniques

Last week when a colleague was reviewing some code I had written, he had a few questions about an unusual exception handling technique I was using. I had been fixing a bug in which the cleanup code from one error was generating another error, and the second exception masked the first. I went through a few contortions before I came up with a solution that allowed the cleanup code to fail but still preserved the original error and traceback for the user.

After our conversation, I decided to write up a quick example to share. I prefaced the description with some basic exception handling information to put it in context, and I posted the resulting article on my site.

0 comments: