Skip to content

Commit b7e4bf9

Browse files
committed
fix: catch unhandled rejections
1 parent efce01a commit b7e4bf9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

source/cli.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const configuration = {
5151
description: {
5252
color: 'toggle formatted output',
5353
edit: 'read last commit message found in ./git/COMMIT_EDITMSG',
54-
'extends': 'array of shareable configurations to extend',
54+
extends: 'array of shareable configurations to extend',
5555
from: 'lower end of the commit range to lint; applies if edit=false',
5656
preset: 'conventional-changelog-preset to use for commit message parsing',
5757
to: 'upper end of the commit range to lint; applies if edit=false',
@@ -126,7 +126,7 @@ async function main(options) {
126126
throw error;
127127
}
128128

129-
console.log('');
129+
return console.log('');
130130
}));
131131
}
132132

@@ -139,4 +139,10 @@ main(cli)
139139
}
140140
throw error;
141141
})
142-
)
142+
);
143+
144+
// Catch unhandled rejections globally
145+
process.on('unhandledRejection', (reason, promise) => {
146+
console.log('Unhandled Rejection at: Promise ', promise, ' reason: ', reason);
147+
throw reason;
148+
});

0 commit comments

Comments
 (0)