Propagate configuration errors from running queries
This commit is contained in:
Родитель
ee4ad8b9d6
Коммит
7e6aa4d65a
|
@ -222,7 +222,8 @@ async function run() {
|
|||
}
|
||||
if (error instanceof analyze_1.CodeQLAnalysisError) {
|
||||
const stats = { ...error.queriesStatusReport };
|
||||
await sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
await sendStatusReport(startedAt, config, stats, error.error, // use the underlying error in case it is a configuration error
|
||||
trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
else {
|
||||
await sendStatusReport(startedAt, config, undefined, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -51,10 +51,12 @@ const upload_lib_1 = require("./upload-lib");
|
|||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
class CodeQLAnalysisError extends Error {
|
||||
constructor(queriesStatusReport, message) {
|
||||
constructor(queriesStatusReport, message, error) {
|
||||
super(message);
|
||||
this.name = "CodeQLAnalysisError";
|
||||
this.queriesStatusReport = queriesStatusReport;
|
||||
this.message = message;
|
||||
this.error = error;
|
||||
this.name = "CodeQLAnalysisError";
|
||||
}
|
||||
}
|
||||
exports.CodeQLAnalysisError = CodeQLAnalysisError;
|
||||
|
@ -184,7 +186,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||
}
|
||||
catch (e) {
|
||||
statusReport.analyze_failure_language = language;
|
||||
throw new CodeQLAnalysisError(statusReport, `Error running analysis for ${language}: ${util.wrapError(e).message}`);
|
||||
throw new CodeQLAnalysisError(statusReport, `Error running analysis for ${language}: ${util.wrapError(e).message}`, util.wrapError(e));
|
||||
}
|
||||
}
|
||||
return statusReport;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -362,7 +362,7 @@ async function run() {
|
|||
startedAt,
|
||||
config,
|
||||
stats,
|
||||
error,
|
||||
error.error, // use the underlying error in case it is a configuration error
|
||||
trapCacheUploadTime,
|
||||
dbCreationTimings,
|
||||
didUploadTrapCaches,
|
||||
|
|
|
@ -26,13 +26,13 @@ import * as util from "./util";
|
|||
import { BuildMode } from "./util";
|
||||
|
||||
export class CodeQLAnalysisError extends Error {
|
||||
queriesStatusReport: QueriesStatusReport;
|
||||
|
||||
constructor(queriesStatusReport: QueriesStatusReport, message: string) {
|
||||
constructor(
|
||||
public queriesStatusReport: QueriesStatusReport,
|
||||
public message: string,
|
||||
public error: Error,
|
||||
) {
|
||||
super(message);
|
||||
|
||||
this.name = "CodeQLAnalysisError";
|
||||
this.queriesStatusReport = queriesStatusReport;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,6 +315,7 @@ export async function runQueries(
|
|||
throw new CodeQLAnalysisError(
|
||||
statusReport,
|
||||
`Error running analysis for ${language}: ${util.wrapError(e).message}`,
|
||||
util.wrapError(e),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче