Improving handling of uploadFailedSarifResult -> [Object object]

This commit is contained in:
Josh Soref 2023-05-22 23:02:01 -04:00
parent a5879b7b6e
commit 789f65c9ee
3 changed files with 5 additions and 3 deletions

View file

@ -110,8 +110,9 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
// but we didn't upload anything.
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
!uploadFailedSarifResult.raw_upload_size_bytes) {
const error = JSON.stringify(uploadFailedSarifResult);
throw new Error("Expected to upload a failed SARIF file for this CodeQL code scanning run, " +
`but the result was instead ${uploadFailedSarifResult}.`);
`but the result was instead ${error}.`);
}
// Upload appropriate Actions artifacts for debugging
if (config.debugMode) {