Implement error handling.