Add try/catch around JSON.parse.