Always include exit code in first line of CommandInvocationError
This commit is contained in:
parent
a3ef0b984b
commit
2eb34f2fb9
3 changed files with 5 additions and 11 deletions
|
|
@ -54,12 +54,9 @@ export class CommandInvocationError extends Error {
|
|||
const prettyCommand = [cmd, ...args]
|
||||
.map((x) => (x.includes(" ") ? `'${x}'` : x))
|
||||
.join(" ");
|
||||
error = error.trim();
|
||||
const separator = error.includes("\n") ? "\n" : " ";
|
||||
super(
|
||||
`Encountered a fatal error while running "${prettyCommand}".${separator}` +
|
||||
`Exit code was ${exitCode} and error was:${separator}` +
|
||||
`${error}`
|
||||
`Encountered a fatal error while running "${prettyCommand}". ` +
|
||||
`Exit code was ${exitCode} and error was: ${error.trim()}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue