Add more error handling to JsonParser.