test for thrown error