Catch some exceptions for testing.