Add test for exception catching.