mirror of
https://github.com/actions/cache.git
synced 2025-04-22 03:56:45 +00:00
Turning error from any to unknown
This commit is contained in:
parent
cab6d27614
commit
f2d5621efc
2 changed files with 19 additions and 12 deletions
15
src/save.ts
15
src/save.ts
|
@ -49,17 +49,18 @@ async function run(): Promise<void> {
|
|||
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
||||
});
|
||||
core.info(`Cache saved with key: ${primaryKey}`);
|
||||
} catch (error: any) {
|
||||
if (error.name === cache.ValidationError.name) {
|
||||
} catch (error: unknown) {
|
||||
const typedError = error as Error;
|
||||
if (typedError.name === cache.ValidationError.name) {
|
||||
throw error;
|
||||
} else if (error.name === cache.ReserveCacheError.name) {
|
||||
core.info(error.message);
|
||||
} else if (typedError.name === cache.ReserveCacheError.name) {
|
||||
core.info(typedError.message);
|
||||
} else {
|
||||
utils.logWarning(error.message);
|
||||
utils.logWarning(typedError.message);
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
utils.logWarning(error.message);
|
||||
} catch (error: unknown) {
|
||||
utils.logWarning((error as Error).message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue