Skip to content

Commit 04b8867

Browse files
author
Danny McCormick
committed
Fail on error
1 parent b96ef73 commit 04b8867

File tree

3 files changed

+52
-24
lines changed

3 files changed

+52
-24
lines changed

lib/setup-python.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ const core = __importStar(require("@actions/core"));
1919
const finder = __importStar(require("./find-python"));
2020
function run() {
2121
return __awaiter(this, void 0, void 0, function* () {
22-
const version = core.getInput('version');
23-
if (version) {
24-
const arch = core.getInput('architecture', { required: true });
25-
yield finder.findPythonVersion(version, arch);
22+
try {
23+
const version = core.getInput('version');
24+
if (version) {
25+
const arch = core.getInput('architecture', { required: true });
26+
yield finder.findPythonVersion(version, arch);
27+
}
28+
}
29+
catch (err) {
30+
core.setFailed(err.message);
2631
}
2732
});
2833
}

package-lock.json

Lines changed: 35 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-python.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import * as core from '@actions/core';
22
import * as finder from './find-python';
33

44
async function run() {
5-
const version: string = core.getInput('version');
6-
if (version) {
7-
const arch: string = core.getInput('architecture', {required: true});
8-
await finder.findPythonVersion(version, arch);
5+
try {
6+
const version: string = core.getInput('version');
7+
if (version) {
8+
const arch: string = core.getInput('architecture', {required: true});
9+
await finder.findPythonVersion(version, arch);
10+
}
11+
} catch (err) {
12+
core.setFailed(err.message);
913
}
1014
}
1115

0 commit comments

Comments
 (0)