mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 20:19:06 +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(cacheKey).toBe(undefined)
|
||||||
expect(logWarningMock).toHaveBeenCalledTimes(1)
|
expect(logWarningMock).toHaveBeenCalledTimes(1)
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(
|
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 {createTar, extractTar, listTar} from './internal/tar'
|
||||||
import {DownloadOptions, UploadOptions} from './options'
|
import {DownloadOptions, UploadOptions} from './options'
|
||||||
|
|
||||||
|
|
||||||
export class ValidationError extends Error {
|
export class ValidationError extends Error {
|
||||||
constructor(message: string) {
|
constructor(message: string) {
|
||||||
super(message)
|
super(message)
|
||||||
@ -128,7 +129,7 @@ export async function restoreCache(
|
|||||||
return cacheEntry.cacheKey
|
return cacheEntry.cacheKey
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Supress all cache related errors because caching should be optional
|
// 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 {
|
} finally {
|
||||||
// Try to delete the archive to save space
|
// Try to delete the archive to save space
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user