mirror of https://github.com/actions/toolkit
adding message field
parent
5008429d2a
commit
0bde6ed088
|
@ -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'
|
||||
)
|
||||
})
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue