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

@ -171,9 +171,10 @@ export async function run(
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}.`
);
}