Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

feat: exit command line tool on unhandled Promise rejections #1840

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ updateNotifier({
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
}).notify()

// Exit if there were undhandled Promise rejections
process.on('unhandledRejection', (error) => {
print(error.message)
process.exit(1)
})

const args = process.argv.slice(2)

const cli = yargs
Expand Down