1
0
Fork 0

adds better error handling

pull/1935/head
Prajjwal 2024-06-03 16:40:16 +05:30
parent 57e2581e9d
commit b719dac88b
3 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "github-actions.warp-cache",
"version": "1.1.13",
"version": "1.1.14",
"preview": true,
"description": "Github action to use WarpBuild's in-house cache offering",
"keywords": [

View File

@ -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
const uploadOptions = getUploadOptions()
const maxChunkSize = uploadOptions?.uploadChunkSize ?? 32 * 1024 * 1024 // Default 32MB
const numberOfChunks = Math.min(
const numberOfChunks = Math.max(
Math.floor(archiveFileSize / maxChunkSize),
1
)

View File

@ -379,6 +379,9 @@ export async function saveCache(
!S3UploadId ||
!S3UploadKey
) {
core.debug(
`S3 params are not set. Number of Chunks: ${S3NumberOfChunks}, PreSigned URLs: ${S3PreSignedURLs}, Upload ID: ${S3UploadId}, Upload Key: ${S3UploadKey}`
)
throw new Error(
'Unable to upload cache to S3. One of the following required parameters is missing: numberOfChunks, preSignedURLs, uploadId, uploadKey.'
)