Trace exceptions instead of suppressing them.

This traces all exceptions to debug output instead of blindly suppressing them. Also includes a convenient mechanism for doing so.