Skip to content

Commit

Permalink
Fixes #9065: uncaught error "ENOENT: no such file or directory" (#9097)
Browse files Browse the repository at this point in the history
* Get log result even if error occurs

* Update changelog

* Simplify await upPromise block
  • Loading branch information
jitbasemartin committed Mar 11, 2022
1 parent 3e90f54 commit b698ed3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
@@ -1,3 +1,6 @@
### Improvements

### Bug Fixes

[sdk/nodejs] - Fix uncaught error "ENOENT: no such file or directory" when an error occurs during the stack up
[#9065](https://github.com/pulumi/pulumi/issues/9065)
5 changes: 2 additions & 3 deletions sdk/nodejs/automation/stack.ts
Expand Up @@ -233,15 +233,14 @@ Event: ${line}\n${e.toString()}`);

const upPromise = this.runPulumiCmd(args, opts?.onOutput);
let upResult: CommandResult;
let logResult: ReadlineResult | undefined;
try {
[upResult, logResult] = await Promise.all([upPromise, logPromise]);
upResult = await upPromise;
} catch (e) {
didError = true;
throw e;
} finally {
onExit(didError);
await cleanUp(logFile, logResult);
await cleanUp(logFile, await logPromise);
}

// TODO: do this in parallel after this is fixed https://github.com/pulumi/pulumi/issues/6050
Expand Down

0 comments on commit b698ed3

Please sign in to comment.