Improve the error page resulting from rejecting promise to service worker respondWith()
Reported by
bke...@mozilla.com,
Oct 28 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0 Steps to reproduce the problem: 1. Visit this site: https://googlechrome.github.io/samples/service-worker/prefetch/index.html 2. Take your machine or browser offline. 3. Click the "not_pre_fetched.txt" link. What is the expected behavior? An interception error page should be shown because the service worker rejects the promise passed to respondWith() in this case. See the SW script here: https://googlechrome.github.io/samples/service-worker/prefetch/service-worker.js The rejection should occur because the script calls `throw()` within the promise `.catch()` just after logging 'Fetching failed:'. What went wrong? Chrome for some reason treats this as a normal network failure. It shows the "page cannot be found" error message instead of its interception failure "something went wrong". This is a compat issue since firefox does treat this as an interception failure instead of a normal network failure. While browsers should feel free to customize their error pages, it feels very weird that a thrown exception in script should be shown as a "server not found" or "can't load page" error. Did this work before? N/A Does this work in other browsers? N/A Chrome version: <Copy from: 'about:version'> Channel: n/a OS Version: 10.0 Flash Version: Shockwave Flash 23.0 r0
,
Nov 2 2016
Our error page at least displays this in console: The FetchEvent for "http://localhost:8093/respond-with-error/not-cached" resulted in a network error response: the promise was rejected. I think this'll need some UX work about what to show the user.
,
Nov 2 2016
We use "corrupted content error" because its the closest thing we have to "this page has screwed up" that the user might understand. For a network error (like offline) we usually show something like "the site could not be found". I think in chrome when you reject a respondWith() promise you normally get a "something went wrong" page. Again, different from the network error.
,
Nov 3 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 3 2017
,
Nov 5
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 7
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by falken@chromium.org
, Nov 2 2016Status: Available (was: Unconfirmed)