Skip to content

Please add error catch on this #145

@stephenjason89

Description

@stephenjason89

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions