Check stdout rather than stderr
This commit is contained in:
parent
a12a861b82
commit
4b37e17ec1
3 changed files with 9 additions and 8 deletions
8
lib/codeql.js
generated
8
lib/codeql.js
generated
|
|
@ -43,11 +43,11 @@ const trap_caching_1 = require("./trap-caching");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
class CommandInvocationError extends Error {
|
class CommandInvocationError extends Error {
|
||||||
constructor(cmd, args, exitCode, error) {
|
constructor(cmd, args, exitCode, error, output) {
|
||||||
super(`Failure invoking ${cmd} with arguments ${args}.\n
|
super(`Failure invoking ${cmd} with arguments ${args}.\n
|
||||||
Exit code ${exitCode} and error was:\n
|
Exit code ${exitCode} and error was:\n
|
||||||
${error}`);
|
${error}`);
|
||||||
this.error = error;
|
this.output = output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.CommandInvocationError = CommandInvocationError;
|
exports.CommandInvocationError = CommandInvocationError;
|
||||||
|
|
@ -486,7 +486,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e instanceof CommandInvocationError &&
|
if (e instanceof CommandInvocationError &&
|
||||||
e.error.includes("undefined symbol: __libc_dlopen_mode, version GLIBC_PRIVATE") &&
|
e.output.includes("undefined symbol: __libc_dlopen_mode, version GLIBC_PRIVATE") &&
|
||||||
process.platform === "linux" &&
|
process.platform === "linux" &&
|
||||||
!(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_TRACING_GLIBC_2_34))) {
|
!(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_TRACING_GLIBC_2_34))) {
|
||||||
throw new util.UserError("The CodeQL CLI is incompatible with the version of glibc on your system. " +
|
throw new util.UserError("The CodeQL CLI is incompatible with the version of glibc on your system. " +
|
||||||
|
|
@ -887,7 +887,7 @@ async function runTool(cmd, args = []) {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
}).exec();
|
}).exec();
|
||||||
if (exitCode !== 0)
|
if (exitCode !== 0)
|
||||||
throw new CommandInvocationError(cmd, args, exitCode, error);
|
throw new CommandInvocationError(cmd, args, exitCode, error, output);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -52,7 +52,8 @@ export class CommandInvocationError extends Error {
|
||||||
cmd: string,
|
cmd: string,
|
||||||
args: string[],
|
args: string[],
|
||||||
exitCode: number,
|
exitCode: number,
|
||||||
public error: string
|
error: string,
|
||||||
|
public output: string
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
`Failure invoking ${cmd} with arguments ${args}.\n
|
`Failure invoking ${cmd} with arguments ${args}.\n
|
||||||
|
|
@ -766,7 +767,7 @@ async function getCodeQLForCmd(
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (
|
if (
|
||||||
e instanceof CommandInvocationError &&
|
e instanceof CommandInvocationError &&
|
||||||
e.error.includes(
|
e.output.includes(
|
||||||
"undefined symbol: __libc_dlopen_mode, version GLIBC_PRIVATE"
|
"undefined symbol: __libc_dlopen_mode, version GLIBC_PRIVATE"
|
||||||
) &&
|
) &&
|
||||||
process.platform === "linux" &&
|
process.platform === "linux" &&
|
||||||
|
|
@ -1294,7 +1295,7 @@ async function runTool(cmd: string, args: string[] = []) {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
}).exec();
|
}).exec();
|
||||||
if (exitCode !== 0)
|
if (exitCode !== 0)
|
||||||
throw new CommandInvocationError(cmd, args, exitCode, error);
|
throw new CommandInvocationError(cmd, args, exitCode, error, output);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue