Troubleshoot

This commit is contained in:
Bassem Dghaidi
2024-12-02 03:35:20 -08:00
committed by GitHub
parent 4a272e9053
commit db1d01308c
3 changed files with 48 additions and 22 deletions

View File

@@ -561,6 +561,7 @@ async function saveCacheV2(
} else {
core.warning(`Failed to save: ${typedError.message}`)
}
throw error
} finally {
// Try to delete the archive to save space
try {

View File

@@ -140,27 +140,30 @@ export async function uploadCacheArchiveSDK(
onProgress: uploadProgress.onProgress()
}
// try {
uploadProgress.startDisplayTimer()
try {
uploadProgress.startDisplayTimer()
core.debug(
`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`
)
const response = await blockBlobClient.uploadFile(archivePath, uploadOptions)
// TODO: better management of non-retryable errors
if (response._response.status >= 400) {
throw new InvalidResponseError(
`Upload failed with status code ${response._response.status}`
core.debug(
`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`
)
}
return response
// } catch (error) {
// core.debug(`Error uploading cache archive: ${error}`)
// throw error
// } finally {
// uploadProgress.stopDisplayTimer()
// }
const response = await blockBlobClient.uploadFile(
archivePath,
uploadOptions
)
// TODO: better management of non-retryable errors
if (response._response.status >= 400) {
throw new 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()
}
}