Compare commits

...

1 commit

Author SHA1 Message Date
evanboyle c845c9802f cleanly exit when nodejs provider encounters exception 2021-05-07 12:54:38 -07:00

View file

@ -442,9 +442,12 @@ export async function main(provider: Provider, args: string[]) {
const uncaughtHandler = (err: Error) => {
if (!uncaughtErrors.has(err)) {
uncaughtErrors.add(err);
// Use `pulumi.log.error` here to tell the engine there was a fatal error, which should
// stop processing subsequent resource operations.
log.error(err.stack || err.message || ("" + err));
// log the first error we see, kill any outstanding work, and exit.
log.error(err.stack || err.message || ("" + err)).then(() => {
runtime.disconnectSync();
process.exit(-1);
});
}
};