Add test for thrown error