mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Refactoring: Simplify retrieving error message
This commit is contained in:
10
lib/debug-artifacts.js
generated
10
lib/debug-artifacts.js
generated
@@ -87,7 +87,7 @@ function tryGetSarifResultPath(config, language, logger) {
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning(`Failed to find SARIF results path for ${language}. Reason: ${(0, util_1.wrapError)(e).message}`);
|
||||
logger.warning(`Failed to find SARIF results path for ${language}. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
@@ -99,13 +99,13 @@ async function tryBundleDatabase(config, language, logger) {
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning(`Failed to bundle database for ${language} using the CLI. ` +
|
||||
`Falling back to a partial bundle. Reason: ${(0, util_1.wrapError)(e).message}`);
|
||||
`Falling back to a partial bundle. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||
}
|
||||
}
|
||||
return [await createPartialDatabaseBundle(config, language)];
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning(`Failed to bundle database for ${language}. Reason: ${(0, util_1.wrapError)(e).message}`);
|
||||
logger.warning(`Failed to bundle database for ${language}. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ async function uploadAllAvailableDebugArtifacts(config, logger) {
|
||||
await uploadDebugArtifacts(filesToUpload, config.dbLocation, config.debugArtifactName);
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.wrapError)(e).message}`);
|
||||
logger.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||
}
|
||||
}
|
||||
async function uploadDebugArtifacts(toUpload, rootDir, artifactName) {
|
||||
@@ -158,7 +158,7 @@ async function uploadDebugArtifacts(toUpload, rootDir, artifactName) {
|
||||
}
|
||||
catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.wrapError)(e).message}`);
|
||||
core.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user