Handle toolcache errors with StartProxyError

This commit is contained in:
Michael B. Gale
2026-01-29 14:16:36 +00:00
parent 1d0f911837
commit 28f6d316c0
4 changed files with 67 additions and 2 deletions
+12 -1
View File
@@ -119796,6 +119796,16 @@ async function extractProxy(logger, archive) {
throw new StartProxyError("Failed to extract proxy archive." /* ExtractionFailed */);
}
}
async function cacheProxy(logger, path2, filename, version) {
try {
return await toolcache.cacheDir(path2, filename, version);
} catch (error3) {
logger.error(
`Failed to add proxy archive from ${path2} to toolcache: ${getErrorMessage(error3)}`
);
throw new StartProxyError("Failed to add proxy to toolcache" /* CacheFailed */);
}
}
// src/start-proxy-action.ts
var KEY_SIZE = 2048;
@@ -119960,7 +119970,8 @@ async function getProxyBinaryPath(logger) {
);
const temp = await downloadProxy(logger, proxyInfo.url, authorization);
const extracted = await extractProxy(logger, temp);
proxyBin = await toolcache2.cacheDir(
proxyBin = await cacheProxy(
logger,
extracted,
proxyFileName,
proxyInfo.version