Use try-catch when parsing json.