diff --git a/service-worker/simple-service-worker/sw.js b/service-worker/simple-service-worker/sw.js index 0d4fae58..8f347663 100644 --- a/service-worker/simple-service-worker/sw.js +++ b/service-worker/simple-service-worker/sw.js @@ -1,11 +1,11 @@ const addResourcesToCache = async (resources) => { const cache = await caches.open('v1'); - await cache.addAll(resources); + cache.addAll(resources).catch(err => console.error(err.stack ?? err)); }; const putInCache = async (request, response) => { const cache = await caches.open('v1'); - await cache.put(request, response); + cache.put(request, response).catch(err => console.error(err.stack ?? err)); }; const cacheFirst = async ({ request, preloadResponsePromise, fallbackUrl }) => {