mirror of https://github.com/actions/toolkit
adds better error handling
parent
57e2581e9d
commit
b719dac88b
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "github-actions.warp-cache",
|
"name": "github-actions.warp-cache",
|
||||||
"version": "1.1.13",
|
"version": "1.1.14",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Github action to use WarpBuild's in-house cache offering",
|
"description": "Github action to use WarpBuild's in-house cache offering",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -368,7 +368,7 @@ export async function saveCache(
|
||||||
// Calculate number of chunks required. This is only required if backend is S3 as Google Cloud SDK will do it for us
|
// Calculate number of chunks required. This is only required if backend is S3 as Google Cloud SDK will do it for us
|
||||||
const uploadOptions = getUploadOptions()
|
const uploadOptions = getUploadOptions()
|
||||||
const maxChunkSize = uploadOptions?.uploadChunkSize ?? 32 * 1024 * 1024 // Default 32MB
|
const maxChunkSize = uploadOptions?.uploadChunkSize ?? 32 * 1024 * 1024 // Default 32MB
|
||||||
const numberOfChunks = Math.min(
|
const numberOfChunks = Math.max(
|
||||||
Math.floor(archiveFileSize / maxChunkSize),
|
Math.floor(archiveFileSize / maxChunkSize),
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
|
|
|
@ -379,6 +379,9 @@ export async function saveCache(
|
||||||
!S3UploadId ||
|
!S3UploadId ||
|
||||||
!S3UploadKey
|
!S3UploadKey
|
||||||
) {
|
) {
|
||||||
|
core.debug(
|
||||||
|
`S3 params are not set. Number of Chunks: ${S3NumberOfChunks}, PreSigned URLs: ${S3PreSignedURLs}, Upload ID: ${S3UploadId}, Upload Key: ${S3UploadKey}`
|
||||||
|
)
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Unable to upload cache to S3. One of the following required parameters is missing: numberOfChunks, preSignedURLs, uploadId, uploadKey.'
|
'Unable to upload cache to S3. One of the following required parameters is missing: numberOfChunks, preSignedURLs, uploadId, uploadKey.'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue