wraps the try-catch JSON.parse error handler in an error object