Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit a64bbf8

Browse files
committed
Handle parse error explicitly
1 parent a156761 commit a64bbf8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

parser-sdk/nodejs/parser-wrapper.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ async function main() {
6565
console.log("Fetching result file")
6666
const { data } = await axios.get(resultFileUrl);
6767
console.log("Fetched result file")
68-
const findings = await parse(data);
68+
69+
let findings = [];
70+
try {
71+
findings = await parse(data);
72+
} catch (error) {
73+
console.error("Parser failed with error:")
74+
console.error(error)
75+
process.exit(1)
76+
}
77+
6978
console.log(`Transformed raw result file into ${findings.length} findings`);
7079

7180
console.log('Adding UUIDs to the findings');

0 commit comments

Comments
 (0)