scaffolder-backend: fix error behaviour in runCommand helper

Signed-off-by: David Dyball <david.dyball@gmail.com>
This commit is contained in:
David Dyball
2022-02-11 14:48:37 +00:00
parent 6471765816
commit 3e59f90b51
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Fix error handling of the `runCommand` helper to return `Error`
instance.
@@ -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();
});