Skip to content

Commit

Permalink
Merge pull request #9482 from daviddyball/master
Browse files Browse the repository at this point in the history
scaffolder-backend: fix error behaviour in runCommand helper
  • Loading branch information
Rugvip committed Feb 11, 2022
2 parents fedb830 + 3e59f90 commit a57621b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/brown-impalas-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder-backend': patch
---

Fix error handling of the `runCommand` helper to return `Error`
instance.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export const runCommand = async ({

process.on('close', code => {
if (code !== 0) {
return reject(`Command ${command} failed, exit code: ${code}`);
return reject(
new Error(`Command ${command} failed, exit code: ${code}`),
);
}
return resolve();
});
Expand Down

0 comments on commit a57621b

Please sign in to comment.