mirror of https://github.com/actions/toolkit
Handle non-successful responses from uploadChunk
parent
f1b118b2a9
commit
678f278caa
|
@ -194,7 +194,7 @@ async function uploadChunk(
|
|||
'Content-Range': getContentRange(start, end)
|
||||
}
|
||||
|
||||
await retryHttpClientResponse(
|
||||
const uploadChunkResponse = await retryHttpClientResponse(
|
||||
`uploadChunk (start: ${start}, end: ${end})`,
|
||||
async () =>
|
||||
httpClient.sendStream(
|
||||
|
@ -204,6 +204,12 @@ async function uploadChunk(
|
|||
additionalHeaders
|
||||
)
|
||||
)
|
||||
|
||||
if (!isSuccessStatusCode(uploadChunkResponse.message.statusCode)) {
|
||||
throw new Error(
|
||||
`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function uploadFile(
|
||||
|
|
Loading…
Reference in New Issue