add a test for thrown errors