Check stdout rather than stderr

This commit is contained in:
Henry Mercer 2022-10-28 18:59:02 +01:00
parent a12a861b82
commit 4b37e17ec1
3 changed files with 9 additions and 8 deletions

8
lib/codeql.js generated
View file

@ -43,11 +43,11 @@ const trap_caching_1 = require("./trap-caching");
const util = __importStar(require("./util"));
const util_1 = require("./util");
class CommandInvocationError extends Error {
constructor(cmd, args, exitCode, error) {
constructor(cmd, args, exitCode, error, output) {
super(`Failure invoking ${cmd} with arguments ${args}.\n
Exit code ${exitCode} and error was:\n
${error}`);
this.error = error;
this.output = output;
}
}
exports.CommandInvocationError = CommandInvocationError;
@ -486,7 +486,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
}
catch (e) {
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" &&
!(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. " +
@ -887,7 +887,7 @@ async function runTool(cmd, args = []) {
ignoreReturnCode: true,
}).exec();
if (exitCode !== 0)
throw new CommandInvocationError(cmd, args, exitCode, error);
throw new CommandInvocationError(cmd, args, exitCode, error, output);
return output;
}
/**