Error handling tests