mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
Add try catch
This commit is contained in:
parent
1d95b404f2
commit
d4d6125cf2
2 changed files with 28 additions and 15 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -67089,6 +67089,7 @@ function getLinuxInfo() {
|
|||
function getOSInfo() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let osInfo;
|
||||
try {
|
||||
if (exports.IS_WINDOWS) {
|
||||
osInfo = yield getWindowsInfo();
|
||||
}
|
||||
|
@ -67098,7 +67099,14 @@ function getOSInfo() {
|
|||
else if (exports.IS_MAC) {
|
||||
osInfo = yield getMacOSInfo();
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
const error = err;
|
||||
core.debug(error.message);
|
||||
}
|
||||
finally {
|
||||
return osInfo;
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.getOSInfo = getOSInfo;
|
||||
|
|
|
@ -179,6 +179,7 @@ async function getLinuxInfo() {
|
|||
|
||||
export async function getOSInfo() {
|
||||
let osInfo;
|
||||
try {
|
||||
if (IS_WINDOWS) {
|
||||
osInfo = await getWindowsInfo();
|
||||
} else if (IS_LINUX) {
|
||||
|
@ -186,6 +187,10 @@ export async function getOSInfo() {
|
|||
} else if (IS_MAC) {
|
||||
osInfo = await getMacOSInfo();
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
const error = err as Error;
|
||||
core.debug(error.message);
|
||||
} finally {
|
||||
return osInfo;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue