Closed Bug 305915 Opened 19 years ago Closed 3 years ago

window.location.reload() does not throw an error on server failure to deliver.

Categories

(Core :: DOM: Core & HTML, defect, P5)

1.7 Branch
x86
Windows XP
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mholloway1, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

I'm trying to get to a situation where I can get a kiosk like thing going in the
browser, and I need page refreshes to survive server timeouts, momentary death,
activity switch of name from one server to another.  That is, stay up no matter
what happens on the server, the browser should survive and not require human
hands to respond to alerts and retry.

I've tried a bunch of stuff (metatags, onerror, on abort, try/catch), that all
work fine (i.e. reload as required) until the server can't deliver the page for
the refresh (I kill the server momentarily to force this to occur).  When this
occurs, I get a connection refused alert in FF.  I think I understand why for
all the cases except the try/catch.

NS7.1 and IE6 also fail.   NS7.1 behaves as FF does (surprise, surprise).  IE6
provides the usual white page of tripe with a bunch of links to retry.

I'll feel silly if I've done something wrong, but I've had a couple others look
and they can't figure it out either.  We think there is possibly something
missing in the handling of window.location.reload().  We think it should leave
the existing page in memory, and throw an exception like "reload failed,
connection error" or "reload failed server timed out" so that the catch can do
something useful, like wait 5 minutes and try again.  Anything to avoid the
alerts coming up..

Please help.  I've asked questions to comp.infosystems.www.authoring.html, and
sourcepoint, but no response (maybe I'm not waiting long enuf or asking right?)

Thanks in advance..  Mike

Reproducible: Always

Steps to Reproduce:
1. Put the following in javascript running in any page.
        try {
            window.status="Should be starting reload right about now.";
            window.location.reload(true);
        } catch (e) {
            alert("aha");
            handleError("aha"+e.message,e.name,e.number)
        }
2. load the page
3. kill the server

Actual Results:  
no alert with aha....  browser caught the error and put up the undesired alert.

Expected Results:  
thrown an error (see description)

I called this major as I think try/catch is a pretty major feature..  I'd be
satisfied if it was normal and just got fixed.  I'd be willing to help, but I've
not yet gotten up the gumption to download the browser code and climb learning
curve for the environment.
Could someone please look at this???  Is there a way I can get this looked at? 
I'm new to mozilla. 
i don't quite understand how this stuff works (i'd love to since i'm 
reimplementing it), but in short reload and friends are async, they can't 
throw. they might trigger onerror or onload or onunload
Assignee: nobody → general
Component: General → DOM: Level 0
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Does that mean the alert I'm seeing when the server fails to provide a page is
borought up in the thing they call "Chrome"????
Component: DOM: Level 0 → Build Config
OS: Windows 2000 → Windows XP
Product: Core → Firefox
Version: Trunk → 1.0 Branch
Assignee: general → nobody
Product: Firefox → Core
QA Contact: ian → build-config
Assignee: nobody → general
Component: Build Config → DOM: Level 0
QA Contact: build-config → ian
Version: 1.0 Branch → 1.7 Branch
Assignee: general → nobody
QA Contact: ian → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5

To do this kind of thing you need application code to drive the browser instance. Or you need to write your site such that it works offline. In any event location.reload() is not the API.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.