add error handling

This commit is contained in:
Dmitry Shibanov 2022-03-01 17:04:59 +03:00
parent f69f00b5e5
commit b01c6d1cb0
2 changed files with 66669 additions and 66658 deletions

133340
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,5 @@
import * as core from '@actions/core';
import { ValidationError } from '@actions/cache';
import * as auth from './auth';
import { getBooleanInput } from './util';
import * as constants from './constants';
@ -46,7 +47,11 @@ async function run() {
await restore(cache);
}
} catch (error) {
if (error.name === ValidationError.name) {
core.setFailed(error.message);
} else {
core.warning(error.message);
}
}
}