Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add error catch on this #145

Open
stephenjason89 opened this issue May 4, 2020 · 0 comments
Open

Please add error catch on this #145

stephenjason89 opened this issue May 4, 2020 · 0 comments

Comments

@stephenjason89
Copy link

stephenjason89 commented May 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant