Improve CommandInvocationError message
This commit is contained in:
parent
c84418936e
commit
0f871fa80d
6 changed files with 19 additions and 12 deletions
7
lib/codeql.js
generated
7
lib/codeql.js
generated
|
|
@ -38,8 +38,11 @@ const util = __importStar(require("./util"));
|
|||
const util_1 = require("./util");
|
||||
class CommandInvocationError extends Error {
|
||||
constructor(cmd, args, exitCode, error, output) {
|
||||
super(`Failure invoking ${cmd} with arguments ${args}.\n` +
|
||||
`Exit code ${exitCode} and error was:\n` +
|
||||
const prettyCommand = [cmd, ...args]
|
||||
.map((x) => (x.includes(" ") ? `'${x}'` : x))
|
||||
.join(" ");
|
||||
super(`Encountered a fatal error while running "${prettyCommand}".\n` +
|
||||
`Exit code was ${exitCode} and error was:\n` +
|
||||
`${error}`);
|
||||
this.exitCode = exitCode;
|
||||
this.error = error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue