MCPcopy
hub / github.com/angular/angular / safeFetch

Method safeFetch

packages/service-worker/worker/src/driver.ts:1375–1385  ·  view source on GitHub ↗
(req: Request)

Source from the content-addressed store, hash-verified

1373 }
1374
1375 async safeFetch(req: Request): Promise<Response> {
1376 try {
1377 return await this.scope.fetch(req);
1378 } catch (err) {
1379 this.debugger.log(err as Error, `Driver.fetch(${req.url})`);
1380 return this.adapter.newResponse(null, {
1381 status: 504,
1382 statusText: 'Gateway Timeout',
1383 });
1384 }
1385 }
1386
1387 private async getCacheNames(): Promise<string[]> {
1388 const controlTable = (await this.controlTable) as CacheTable;

Callers 3

handleFetchMethod · 0.95
fetchLatestManifestMethod · 0.95

Calls 3

logMethod · 0.65
fetchMethod · 0.45
newResponseMethod · 0.45

Tested by

no test coverage detected