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
7
lib/codeql.js
generated
7
lib/codeql.js
generated
|
|
@ -41,11 +41,8 @@ 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}`);
|
||||
super(`Encountered a fatal error while running "${prettyCommand}". ` +
|
||||
`Exit code was ${exitCode} and error was: ${error.trim()}`);
|
||||
this.exitCode = exitCode;
|
||||
this.error = error;
|
||||
this.output = output;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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