Skip to content

Commit

Permalink
scaffolder-backend: fix error behaviour in runCommand helper
Browse files Browse the repository at this point in the history
Signed-off-by: David Dyball <david.dyball@gmail.com>
  • Loading branch information
daviddyball committed Feb 11, 2022
1 parent 6471765 commit 3e59f90
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
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder-backend': patch
---

Fix error handling of the `runCommand` helper to return `Error`
instance.
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 3e59f90

Please sign in to comment.