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(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'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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…
Reference in New Issue