Re-enable waiting for processing by default, using the new API semantics.

This commit is contained in:
Chris Gavin 2022-03-30 10:55:22 +01:00
parent d8576e34bf
commit 9885f86fab
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
6 changed files with 13 additions and 26 deletions

16
lib/upload-lib.js generated
View file

@ -322,23 +322,15 @@ async function waitForProcessing(repositoryNwo, sarifID, apiDetails, logger) {
if (status === "complete") {
break;
}
else if (status === "pending") {
logger.debug("Analysis processing is still pending...");
}
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)) {
switch (e.status) {
case 404:
logger.debug("Analysis is not found yet...");
break; // Note this breaks from the case statement, not the outer loop.
default:
throw e;
}
}
else {
throw e;
}
logger.warning(`An error occurred checking the status of the delivery. ${e} It should still be processed in the background, but errors that occur during processing may not be reported.`);
}
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS);
}

File diff suppressed because one or more lines are too long