From e52e34ba17846a8305514ca2459c4102b88a10cf Mon Sep 17 00:00:00 2001 From: Robert Brignull Date: Fri, 1 May 2020 11:20:21 +0100 Subject: [PATCH] remove change to behaviour on 500 errors --- lib/upload-lib.js | 6 ++++++ src/upload-lib.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 668f5f8cc..d8f4639d9 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -83,6 +83,12 @@ async function uploadPayload(payload) { // Sleep for the backoff period await new Promise(r => setTimeout(r, backoffPeriods[attempt] * 1000)); } + else if (res.message.statusCode === 500) { + // If the upload fails with 500 then we assume it is a temporary problem + // with turbo-scan and not an error that the user has caused or can fix. + // We avoid marking the job as failed to avoid breaking CI workflows. + core.error('Upload failed (' + requestID + '): ' + await res.readBody()); + } else { core.setFailed('Upload failed (' + requestID + '): ' + await res.readBody()); } diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 18d43f861..1342ccfa8 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -83,6 +83,12 @@ async function uploadPayload(payload) { // Sleep for the backoff period await new Promise(r => setTimeout(r, backoffPeriods[attempt] * 1000)); + } else if (res.message.statusCode === 500) { + // If the upload fails with 500 then we assume it is a temporary problem + // with turbo-scan and not an error that the user has caused or can fix. + // We avoid marking the job as failed to avoid breaking CI workflows. + core.error('Upload failed (' + requestID + '): ' + await res.readBody()); + } else { core.setFailed('Upload failed (' + requestID + '): ' + await res.readBody()); }