diff --git a/dist/restore-only/index.js b/dist/restore-only/index.js index 17e6d1c..978beff 100644 --- a/dist/restore-only/index.js +++ b/dist/restore-only/index.js @@ -6290,6 +6290,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { else { core.warning(`Failed to save: ${typedError.message}`); } + throw error; } finally { // Try to delete the archive to save space @@ -9838,15 +9839,23 @@ function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { maxSingleShotSize: 128 * 1024 * 1024, onProgress: uploadProgress.onProgress() }; - // try { - uploadProgress.startDisplayTimer(); - core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); - const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); - // TODO: better management of non-retryable errors - if (response._response.status >= 400) { - throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + try { + uploadProgress.startDisplayTimer(); + core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); + // TODO: better management of non-retryable errors + if (response._response.status >= 400) { + throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + } + return response; + } + catch (error) { + core.debug(`Error uploading cache archive: ${error}`); + throw error; + } + finally { + uploadProgress.stopDisplayTimer(); } - return response; }); } exports.uploadCacheArchiveSDK = uploadCacheArchiveSDK; diff --git a/dist/restore/index.js b/dist/restore/index.js index 630f80b..cc4c94e 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -6290,6 +6290,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { else { core.warning(`Failed to save: ${typedError.message}`); } + throw error; } finally { // Try to delete the archive to save space @@ -9838,15 +9839,23 @@ function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { maxSingleShotSize: 128 * 1024 * 1024, onProgress: uploadProgress.onProgress() }; - // try { - uploadProgress.startDisplayTimer(); - core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); - const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); - // TODO: better management of non-retryable errors - if (response._response.status >= 400) { - throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + try { + uploadProgress.startDisplayTimer(); + core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); + // TODO: better management of non-retryable errors + if (response._response.status >= 400) { + throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + } + return response; + } + catch (error) { + core.debug(`Error uploading cache archive: ${error}`); + throw error; + } + finally { + uploadProgress.stopDisplayTimer(); } - return response; }); } exports.uploadCacheArchiveSDK = uploadCacheArchiveSDK; diff --git a/dist/save-only/index.js b/dist/save-only/index.js index 506baf6..15b0a76 100644 --- a/dist/save-only/index.js +++ b/dist/save-only/index.js @@ -6290,6 +6290,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { else { core.warning(`Failed to save: ${typedError.message}`); } + throw error; } finally { // Try to delete the archive to save space @@ -9838,15 +9839,23 @@ function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { maxSingleShotSize: 128 * 1024 * 1024, onProgress: uploadProgress.onProgress() }; - // try { - uploadProgress.startDisplayTimer(); - core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); - const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); - // TODO: better management of non-retryable errors - if (response._response.status >= 400) { - throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + try { + uploadProgress.startDisplayTimer(); + core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); + // TODO: better management of non-retryable errors + if (response._response.status >= 400) { + throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + } + return response; + } + catch (error) { + core.debug(`Error uploading cache archive: ${error}`); + throw error; + } + finally { + uploadProgress.stopDisplayTimer(); } - return response; }); } exports.uploadCacheArchiveSDK = uploadCacheArchiveSDK; diff --git a/dist/save/index.js b/dist/save/index.js index 0818d64..4484f36 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -6290,6 +6290,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { else { core.warning(`Failed to save: ${typedError.message}`); } + throw error; } finally { // Try to delete the archive to save space @@ -9838,15 +9839,23 @@ function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { maxSingleShotSize: 128 * 1024 * 1024, onProgress: uploadProgress.onProgress() }; - // try { - uploadProgress.startDisplayTimer(); - core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); - const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); - // TODO: better management of non-retryable errors - if (response._response.status >= 400) { - throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + try { + uploadProgress.startDisplayTimer(); + core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); + // TODO: better management of non-retryable errors + if (response._response.status >= 400) { + throw new errors_1.InvalidResponseError(`Upload failed with status code ${response._response.status}`); + } + return response; + } + catch (error) { + core.debug(`Error uploading cache archive: ${error}`); + throw error; + } + finally { + uploadProgress.stopDisplayTimer(); } - return response; }); } exports.uploadCacheArchiveSDK = uploadCacheArchiveSDK;