Return error if JSON parse fails

- If the try catch fails return the error.