Skip to content

Commit 3e118b1

Browse files
committed
Improve error handling
1 parent b38e918 commit 3e118b1

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

dist/pre/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88197,16 +88197,16 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
8819788197
version: cacheUtils.getCacheVersion([cacheFilePath], compressionMethod, false),
8819888198
};
8819988199
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
88200-
if (!response.ok) {
88201-
lib_core.debug(`Cache not found for version ${request.version} of keys: ${cacheKey}`);
88202-
return undefined;
88203-
}
8820488200
const url = new URL(response.signedDownloadUrl);
8820588201
lib_core.info(`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`);
8820688202
confg.allowed_endpoints += ` ${url.hostname}:443`;
8820788203
}
8820888204
catch (e) {
88209-
lib_core.error(`v2 failed: ${e}`);
88205+
lib_core.info(`Unable to fetch cacheURL ${e}`);
88206+
if (confg.egress_policy === "block") {
88207+
lib_core.info("Switching egress-policy to audit mode");
88208+
confg.egress_policy = "audit";
88209+
}
8821088210
}
8821188211
break;
8821288212
case "v1":

dist/pre/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,18 @@ interface MonitorResponse {
145145
request
146146
);
147147

148-
if (!response.ok) {
149-
core.debug(
150-
`Cache not found for version ${request.version} of keys: ${cacheKey}`
151-
);
152-
return undefined;
153-
}
154-
155148
const url = new URL(response.signedDownloadUrl);
156149
core.info(
157150
`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`
158151
);
159152

160153
confg.allowed_endpoints += ` ${url.hostname}:443`;
161154
} catch (e) {
162-
core.error(`v2 failed: ${e}`);
155+
core.info(`Unable to fetch cacheURL ${e}`);
156+
if (confg.egress_policy === "block") {
157+
core.info("Switching egress-policy to audit mode");
158+
confg.egress_policy = "audit";
159+
}
163160
}
164161
break;
165162

0 commit comments

Comments
 (0)