Test cases for error handling.