mirror of
https://github.com/github/codeql-action.git
synced 2026-08-05 04:57:19 -05:00
Add error handling for undefined extractors in language resolution
This commit is contained in:
Generated
+7
-1
@@ -154094,7 +154094,13 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
},
|
||||
async resolveExtractor(language) {
|
||||
const output = await this.resolveLanguages();
|
||||
return output.extractors[language][0].extractor_root;
|
||||
const extractors = output.extractors[language];
|
||||
if (extractors === void 0) {
|
||||
throw new Error(
|
||||
`Unable to resolve an extractor for the language '${language}'.`
|
||||
);
|
||||
}
|
||||
return extractors[0].extractor_root;
|
||||
},
|
||||
async resolveQueriesStartingPacks(queries) {
|
||||
const codeqlArgs = [
|
||||
|
||||
+7
-1
@@ -994,7 +994,13 @@ async function getCodeQLForCmd(
|
||||
// This can be a bit slow due to the JVM startup cost. Instead, get
|
||||
// the extractor path from resolveLanguages(), which caches its output.
|
||||
const output = await this.resolveLanguages();
|
||||
return output.extractors[language][0].extractor_root;
|
||||
const extractors = output.extractors[language];
|
||||
if (extractors === undefined) {
|
||||
throw new Error(
|
||||
`Unable to resolve an extractor for the language '${language}'.`,
|
||||
);
|
||||
}
|
||||
return extractors[0].extractor_root;
|
||||
},
|
||||
async resolveQueriesStartingPacks(queries: string[]): Promise<string[]> {
|
||||
const codeqlArgs = [
|
||||
|
||||
Reference in New Issue
Block a user