UpUp icon indicating copy to clipboard operation
UpUp copied to clipboard

Please add error catch on this

Open stephenjason89 opened this issue 5 years ago • 0 comments

line 60 of src/upup.sw.js

      if (settings['assets']) {
        cache.addAll(settings['assets'].map(function (urlToPrefetch) {
          return new Request(urlToPrefetch, {mode: 'no-cors'});
        }));
      }
    } 

it throws Failed to fetch when offline

also line 93

  }).then(function () {
    // Delete old caches
    return caches.keys().then(function (cacheNames) {
      return Promise.all(
        cacheNames.map(function (cacheName) {
          if (cacheName.startsWith(_CACHE_NAME_PREFIX) && newCacheName !== cacheName) {
            return caches.delete(cacheName);
          }
        })
      );
    });
  })

please add error handling to avoid throwing errors

Thank you

stephenjason89 avatar May 04 '20 18:05 stephenjason89