Skip to content

Commit 0066de9

Browse files
committed
Relaxed error handling for failing to save cache - shouldn't break the build asdf-vm#235
1 parent 300dfed commit 0066de9

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

install/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18989,10 +18989,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1898918989
command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899018990
}
1899118991
exports.error = error;
18992-
function warning(message, properties = {}) {
18992+
function warning2(message, properties = {}) {
1899318993
command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899418994
}
18995-
exports.warning = warning;
18995+
exports.warning = warning2;
1899618996
function notice(message, properties = {}) {
1899718997
command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899818998
}
@@ -21017,10 +21017,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
2101721017
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2101821018
}
2101921019
exports.error = error;
21020-
function warning(message, properties = {}) {
21020+
function warning2(message, properties = {}) {
2102121021
(0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2102221022
}
21023-
exports.warning = warning;
21023+
exports.warning = warning2;
2102421024
function notice(message, properties = {}) {
2102521025
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2102621026
}
@@ -28518,11 +28518,11 @@ var require_checkInsecureConnection = __commonJS({
2851828518
return false;
2851928519
}
2852028520
function emitInsecureConnectionWarning() {
28521-
const warning = "Sending token over insecure transport. Assume any token issued is compromised.";
28522-
log_js_1.logger.warning(warning);
28521+
const warning2 = "Sending token over insecure transport. Assume any token issued is compromised.";
28522+
log_js_1.logger.warning(warning2);
2852328523
if (typeof (process === null || process === void 0 ? void 0 : process.emitWarning) === "function" && !insecureConnectionWarningEmmitted) {
2852428524
insecureConnectionWarningEmmitted = true;
28525-
process.emitWarning(warning);
28525+
process.emitWarning(warning2);
2852628526
}
2852728527
}
2852828528
function ensureSecureConnection(request, options) {

install/post.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18989,10 +18989,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1898918989
command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899018990
}
1899118991
exports.error = error;
18992-
function warning(message, properties = {}) {
18992+
function warning2(message, properties = {}) {
1899318993
command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899418994
}
18995-
exports.warning = warning;
18995+
exports.warning = warning2;
1899618996
function notice(message, properties = {}) {
1899718997
command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
1899818998
}
@@ -21017,10 +21017,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
2101721017
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2101821018
}
2101921019
exports.error = error;
21020-
function warning(message, properties = {}) {
21020+
function warning2(message, properties = {}) {
2102121021
(0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2102221022
}
21023-
exports.warning = warning;
21023+
exports.warning = warning2;
2102421024
function notice(message, properties = {}) {
2102521025
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
2102621026
}
@@ -28518,11 +28518,11 @@ var require_checkInsecureConnection = __commonJS({
2851828518
return false;
2851928519
}
2852028520
function emitInsecureConnectionWarning() {
28521-
const warning = "Sending token over insecure transport. Assume any token issued is compromised.";
28522-
log_js_1.logger.warning(warning);
28521+
const warning2 = "Sending token over insecure transport. Assume any token issued is compromised.";
28522+
log_js_1.logger.warning(warning2);
2852328523
if (typeof (process === null || process === void 0 ? void 0 : process.emitWarning) === "function" && !insecureConnectionWarningEmmitted) {
2852428524
insecureConnectionWarningEmmitted = true;
28525-
process.emitWarning(warning);
28525+
process.emitWarning(warning2);
2852628526
}
2852728527
}
2852828528
function ensureSecureConnection(request, options) {
@@ -66813,10 +66813,15 @@ function assemblePaths() {
6681366813
];
6681466814
}
6681566815
async function saveAsdfCache() {
66816-
const { cacheKey } = await assembleCacheKey();
66817-
const paths = assemblePaths();
66818-
core3.info(`Saving ${paths.join(", ")} to cache with key "${cacheKey}"`);
66819-
return cache.saveCache(paths, cacheKey);
66816+
try {
66817+
const { cacheKey } = await assembleCacheKey();
66818+
const paths = assemblePaths();
66819+
core3.info(`Saving ${paths.join(", ")} to cache with key "${cacheKey}"`);
66820+
return await cache.saveCache(paths, cacheKey);
66821+
} catch (error) {
66822+
core3.warning(error);
66823+
return -1;
66824+
}
6682066825
}
6682166826

6682266827
// src/install/index.ts

src/caching/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ export async function restoreAsdfCache() {
4949
}
5050

5151
export async function saveAsdfCache() {
52-
const {cacheKey} = await assembleCacheKey();
53-
const paths = assemblePaths();
54-
core.info(`Saving ${paths.join(', ')} to cache with key "${cacheKey}"`);
55-
return cache.saveCache(paths, cacheKey);
52+
try {
53+
const {cacheKey} = await assembleCacheKey();
54+
const paths = assemblePaths();
55+
core.info(`Saving ${paths.join(', ')} to cache with key "${cacheKey}"`);
56+
return await cache.saveCache(paths, cacheKey);
57+
} catch (error: unknown) {
58+
core.warning(error as Error);
59+
return -1;
60+
}
5661
}

0 commit comments

Comments
 (0)