1
0
Fork 0

adding message field

pull/1122/head
Shubham Tiwari 2022-06-20 08:00:59 +00:00 committed by GitHub
parent 5008429d2a
commit 0bde6ed088
2 changed files with 3 additions and 2 deletions

View File

@ -83,7 +83,7 @@ test('restore with server error should fail', async () => {
expect(cacheKey).toBe(undefined)
expect(logWarningMock).toHaveBeenCalledTimes(1)
expect(logWarningMock).toHaveBeenCalledWith(
'Fail to restore: Error: HTTP Error Occurred'
'Fail to restore: HTTP Error Occurred'
)
})

View File

@ -5,6 +5,7 @@ import * as cacheHttpClient from './internal/cacheHttpClient'
import {createTar, extractTar, listTar} from './internal/tar'
import {DownloadOptions, UploadOptions} from './options'
export class ValidationError extends Error {
constructor(message: string) {
super(message)
@ -128,7 +129,7 @@ export async function restoreCache(
return cacheEntry.cacheKey
} catch (error) {
// Supress all cache related errors because caching should be optional
core.warning(`Fail to restore: ${error}`)
core.warning(`Fail to restore: ${(error as Error).message}`)
} finally {
// Try to delete the archive to save space
try {