Merge pull request #7894 from backstage/freben/early-super

Call the super constructor early
This commit is contained in:
Fredrik Adelöw
2021-11-08 12:02:41 +01:00
committed by GitHub
2 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Make `ExitCodeError` call `super` early to avoid compiler warnings
+5 -5
View File
@@ -26,11 +26,11 @@ export class ExitCodeError extends CustomError {
readonly code: number;
constructor(code: number, command?: string) {
if (command) {
super(`Command '${command}' exited with code ${code}`);
} else {
super(`Child exited with code ${code}`);
}
super(
command
? `Command '${command}' exited with code ${code}`
: `Child exited with code ${code}`,
);
this.code = code;
}
}