Check for errors in the analysis status response.

This commit is contained in:
Chris Gavin 2021-11-17 12:19:03 +00:00
parent 823bb21bbb
commit e0b9b9a248
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 8 additions and 1 deletions

3
lib/upload-lib.js generated
View file

@ -294,6 +294,9 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe
if (status === "complete") {
break;
}
else if (status === "failed") {
throw new Error(`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`);
}
}
catch (e) {
if (util.isHTTPError(e)) {

File diff suppressed because one or more lines are too long

View file

@ -440,6 +440,10 @@ async function uploadFiles(
logger.info(`Analysis upload status is ${status}.`);
if (status === "complete") {
break;
} else if (status === "failed") {
throw new Error(
`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`
);
}
} catch (e) {
if (util.isHTTPError(e)) {