test for error and exceptions