Add test for exception