Skip to content

Commit

Permalink
fix(protect): catch and log unexpected errors
Browse files Browse the repository at this point in the history
Otherwise we'll get "UnhandledPromiseRejectionWarning" warnings from
NodeJS which warns us that their behaviour will change to non-zero exit
codes in the future. We don't want that and we shouldn't block pipelines
due to failures on our end.
  • Loading branch information
Jahed Ahmed committed Aug 19, 2021
1 parent c9ddb44 commit ca2177a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/snyk-protect/bin/snyk-protect
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/usr/bin/env node
require('../dist/index.js').protect();
require('../dist/index.js')
.protect()
.catch((error) => {
// don't block pipelines on unexpected errors
console.error(error);
});

0 comments on commit ca2177a

Please sign in to comment.