Error handling test