Add try catch

This commit is contained in:
MaksimZhukov 2022-12-06 17:07:51 +01:00
parent 1d95b404f2
commit d4d6125cf2
2 changed files with 28 additions and 15 deletions

8
dist/setup/index.js vendored
View file

@ -67089,6 +67089,7 @@ function getLinuxInfo() {
function getOSInfo() { function getOSInfo() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let osInfo; let osInfo;
try {
if (exports.IS_WINDOWS) { if (exports.IS_WINDOWS) {
osInfo = yield getWindowsInfo(); osInfo = yield getWindowsInfo();
} }
@ -67098,7 +67099,14 @@ function getOSInfo() {
else if (exports.IS_MAC) { else if (exports.IS_MAC) {
osInfo = yield getMacOSInfo(); osInfo = yield getMacOSInfo();
} }
}
catch (err) {
const error = err;
core.debug(error.message);
}
finally {
return osInfo; return osInfo;
}
}); });
} }
exports.getOSInfo = getOSInfo; exports.getOSInfo = getOSInfo;

View file

@ -179,6 +179,7 @@ async function getLinuxInfo() {
export async function getOSInfo() { export async function getOSInfo() {
let osInfo; let osInfo;
try {
if (IS_WINDOWS) { if (IS_WINDOWS) {
osInfo = await getWindowsInfo(); osInfo = await getWindowsInfo();
} else if (IS_LINUX) { } else if (IS_LINUX) {
@ -186,6 +187,10 @@ export async function getOSInfo() {
} else if (IS_MAC) { } else if (IS_MAC) {
osInfo = await getMacOSInfo(); osInfo = await getMacOSInfo();
} }
} catch (err) {
const error = err as Error;
core.debug(error.message);
} finally {
return osInfo; return osInfo;
}
} }