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)
|
'Content-Range': getContentRange(start, end)
|
||||||
}
|
}
|
||||||
|
|
||||||
await retryHttpClientResponse(
|
const uploadChunkResponse = await retryHttpClientResponse(
|
||||||
`uploadChunk (start: ${start}, end: ${end})`,
|
`uploadChunk (start: ${start}, end: ${end})`,
|
||||||
async () =>
|
async () =>
|
||||||
httpClient.sendStream(
|
httpClient.sendStream(
|
||||||
|
@ -204,6 +204,12 @@ async function uploadChunk(
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!isSuccessStatusCode(uploadChunkResponse.message.statusCode)) {
|
||||||
|
throw new Error(
|
||||||
|
`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function uploadFile(
|
async function uploadFile(
|
||||||
|
|
Loading…
Reference in New Issue