mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 12:09:12 +08:00
adding message field
This commit is contained in:
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'
|
||||
)
|
||||
})
|
||||
|
||||
|
3
packages/cache/src/cache.ts
vendored
3
packages/cache/src/cache.ts
vendored
@ -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…
x
Reference in New Issue
Block a user