google-api-typings-generator icon indicating copy to clipboard operation
google-api-typings-generator copied to clipboard

Better way to fail for unhandled rejections

Open Maxim-Mazurok opened this issue 4 years ago • 0 comments

Currently we have

process.on('unhandledRejection', reason => {
  throw reason;
});

in order to quit node process with error code on unhandled rejected promises. Which might not be the best way to do it. First of all, we have many scripts where we need this and code duplication is not a good thing, at least we should make it includable.

Also, we might want to use --unhandled-rejections=strict option for node instead. But first we have to verify that ts-node supports it, and then add it to package.json scripts, probably.

Maxim-Mazurok avatar Apr 10 '20 14:04 Maxim-Mazurok