Improve error handling
This commit is contained in:
Vendored
+5
-5
@@ -88197,16 +88197,16 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
|
||||
version: cacheUtils.getCacheVersion([cacheFilePath], compressionMethod, false),
|
||||
};
|
||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||
if (!response.ok) {
|
||||
lib_core.debug(`Cache not found for version ${request.version} of keys: ${cacheKey}`);
|
||||
return undefined;
|
||||
}
|
||||
const url = new URL(response.signedDownloadUrl);
|
||||
lib_core.info(`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`);
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
}
|
||||
catch (e) {
|
||||
lib_core.error(`v2 failed: ${e}`);
|
||||
lib_core.info(`Unable to fetch cacheURL ${e}`);
|
||||
if (confg.egress_policy === "block") {
|
||||
lib_core.info("Switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "v1":
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+5
-8
@@ -145,13 +145,6 @@ interface MonitorResponse {
|
||||
request
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
core.debug(
|
||||
`Cache not found for version ${request.version} of keys: ${cacheKey}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const url = new URL(response.signedDownloadUrl);
|
||||
core.info(
|
||||
`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`
|
||||
@@ -159,7 +152,11 @@ interface MonitorResponse {
|
||||
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
} catch (e) {
|
||||
core.error(`v2 failed: ${e}`);
|
||||
core.info(`Unable to fetch cacheURL ${e}`);
|
||||
if (confg.egress_policy === "block") {
|
||||
core.info("Switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user