New issue
Advanced search Search tips

Issue 660377 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Improve the error page resulting from rejecting promise to service worker respondWith()

Reported by bke...@mozilla.com, Oct 28 2016

Issue description

UserAgent: 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
 
Labels: -OS-Windows -Pri-2 OS-All Pri-3
Status: Available (was: Unconfirmed)
bkelly: I get this error from Firefox Nightly, which looks like a normal network failure.

"Corrupted Content Error

The site at https://googlechrome.github.io/samples/service-worker/prefetch/static/not_pre_fetched.txt has experienced a network protocol violation that cannot be repaired.

The page you are trying to view cannot be shown because an error in the data transmission was detected.

    Please contact the website owners to inform them of this problem."

That said, Chrome doesn't have an "interception failure" error page... so that's our first problem.
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.

Comment 3 by bke...@mozilla.com, 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.
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 3 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
Summary: Improve the error page resulting from rejecting promise to service worker respondWith() (was: rejecting promise to service worker respondWith() does not show correct error page)
Project Member

Comment 6 by sheriffbot@chromium.org, Nov 5

Status: Untriaged (was: Available)
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
Status: Available (was: Untriaged)

Sign in to add a comment