Address comments

This commit is contained in:
Arthur Baars 2021-05-24 11:00:02 +02:00
parent 4f51b8c47e
commit 44c6b33642
3 changed files with 25 additions and 5 deletions

14
lib/codeql.js generated
View file

@ -429,7 +429,12 @@ function getCodeQLForCmd(cmd) {
}, },
}, },
}).exec(); }).exec();
return JSON.parse(output); try {
return JSON.parse(output);
}
catch (e) {
throw new Error(`Unexpected output from codeql resolve languages: ${e}`);
}
}, },
async resolveQueries(queries, extraSearchPath) { async resolveQueries(queries, extraSearchPath) {
const codeqlArgs = [ const codeqlArgs = [
@ -450,7 +455,12 @@ function getCodeQLForCmd(cmd) {
}, },
}, },
}).exec(); }).exec();
return JSON.parse(output); try {
return JSON.parse(output);
}
catch (e) {
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
}
}, },
async databaseAnalyze(databasePath, sarifFile, extraSearchPath, querySuite, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId) { async databaseAnalyze(databasePath, sarifFile, extraSearchPath, querySuite, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId) {
const args = [ const args = [

File diff suppressed because one or more lines are too long

View file

@ -674,7 +674,13 @@ function getCodeQLForCmd(cmd: string): CodeQL {
}, },
}).exec(); }).exec();
return JSON.parse(output); try {
return JSON.parse(output);
} catch (e) {
throw new Error(
`Unexpected output from codeql resolve languages: ${e}`
);
}
}, },
async resolveQueries( async resolveQueries(
queries: string[], queries: string[],
@ -699,7 +705,11 @@ function getCodeQLForCmd(cmd: string): CodeQL {
}, },
}).exec(); }).exec();
return JSON.parse(output); try {
return JSON.parse(output);
} catch (e) {
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
}
}, },
async databaseAnalyze( async databaseAnalyze(
databasePath: string, databasePath: string,