Error handling for JSON file.