catch errors in test cases