diff --git a/scripts/momentOfTruth.js b/scripts/momentOfTruth.js index 2fecae05cbbf..1830e915eee9 100644 --- a/scripts/momentOfTruth.js +++ b/scripts/momentOfTruth.js @@ -74,18 +74,9 @@ async function getLinterResult(swaggerPath) { let resultString = stderr; if (resultString.indexOf('{') !== -1) { resultString = "[" + resultString.substring(resultString.indexOf('{')).trim().replace(/\}\n\{/g, "},\n{") + "]"; - //console.log('>>>>>> Trimmed Result...'); - //console.log(resultString); - try { - jsonResult = JSON.parse(resultString); - //console.log('>>>>>> Parsed Result...'); - //console.dir(resultObject, {depth: null, colors: true}); - return jsonResult; - } catch (e) { - console.log(`An error occurred while executing JSON.parse() on the linter output for ${swaggerPath}:`); - console.dir(resultString); - console.dir(e, { depth: null, colors: true }); - } + // Do not catch the JSON parse error + jsonResult = JSON.parse(resultString); + return jsonResult; } return []; };