mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
add error handling
This commit is contained in:
parent
f69f00b5e5
commit
b01c6d1cb0
2 changed files with 66669 additions and 66658 deletions
133380
dist/setup/index.js
vendored
133380
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,5 @@
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
import { ValidationError } from '@actions/cache';
|
||||||
import * as auth from './auth';
|
import * as auth from './auth';
|
||||||
import { getBooleanInput } from './util';
|
import { getBooleanInput } from './util';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
|
@ -46,7 +47,11 @@ async function run() {
|
||||||
await restore(cache);
|
await restore(cache);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.name === ValidationError.name) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
} else {
|
||||||
|
core.warning(error.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue