Handle API versions that reject unsuccessful executions

This commit is contained in:
Henry Mercer 2022-11-25 16:45:37 +00:00
parent 122b180b66
commit 37b4358e44
3 changed files with 27 additions and 7 deletions

View file

@ -67,11 +67,21 @@ async function uploadFailedSarif(
logger
);
if (uploadResult !== undefined && waitForProcessing) {
await uploadLib.waitForProcessing(
repositoryNwo,
uploadResult.sarifID,
logger
);
try {
await uploadLib.waitForProcessing(
repositoryNwo,
uploadResult.sarifID,
logger
);
} catch (e) {
if (e instanceof Error && e.message.includes("unsuccessful execution")) {
logger.info(
"Submitting a SARIF file for the failed run isn't yet supported, continuing."
);
} else {
throw e;
}
}
}
}