mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 23:00:26 +00:00
Throw a UserError when MissingTokenException is detected
This error should not contribute to our internal failure count.
This commit is contained in:
Generated
+5
-4
@@ -47,7 +47,7 @@ async function initConfig(languagesInput, queriesInput, packsInput, configFile,
|
||||
}
|
||||
exports.initConfig = initConfig;
|
||||
async function runInit(codeql, config, sourceRoot, processName, processLevel) {
|
||||
var _a, _b;
|
||||
var _a, _b, _c;
|
||||
fs.mkdirSync(config.dbLocation, { recursive: true });
|
||||
try {
|
||||
if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
|
||||
@@ -62,15 +62,16 @@ async function runInit(codeql, config, sourceRoot, processName, processLevel) {
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Handle the situation where init is called twice
|
||||
// for the same database in the same job.
|
||||
if (e instanceof Error &&
|
||||
((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes("Refusing to create databases")) &&
|
||||
e.message.includes("exists and is not an empty directory.")) {
|
||||
// Handle the situation where init is called twice
|
||||
// for the same database in the same job.
|
||||
throw new util.UserError(`Is the "init" action called twice in the same job? ${e.message}`);
|
||||
}
|
||||
else if (e instanceof Error &&
|
||||
((_b = e.message) === null || _b === void 0 ? void 0 : _b.includes("is not compatible with this CodeQL CLI"))) {
|
||||
(((_b = e.message) === null || _b === void 0 ? void 0 : _b.includes("is not compatible with this CodeQL CLI")) ||
|
||||
((_c = e.message) === null || _c === void 0 ? void 0 : _c.includes("eventual cause: MissingTokenException")))) {
|
||||
throw new util.UserError(e.message);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user