Merge pull request #9482 from daviddyball/master

scaffolder-backend: fix error behaviour in runCommand helper
This commit is contained in:
Patrik Oldsberg
2022-02-12 00:16:05 +01:00
committed by GitHub
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();
});