Re: [slightlyoff/ServiceWorker] Recovering from fetch failures (#939)

`fetchEvent.isResponseAcceptable(response)` or similar would help here.

```js
event.respondWith(
  something.then(response => {
    if (!event.isResponseAcceptable(response)) throw Error("Boom");
    return response;
  }).catch(() => {
    return fetch(event.request).catch(() => genericErrorPage);
  })
)
```

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/939#issuecomment-237276864

Received on Wednesday, 3 August 2016 17:13:57 UTC