Opened 14 years ago

Closed 14 years ago

#197 closed defect (duplicate)

http status doesn't exist when server is down

Reported by: anonymous Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.1
Keywords: http status error NS_ERROR_NOT_AVAILABLE server down Cc:
Blocked By: Blocking:

Description

Linux Firefox 1.5b1: If the server is down, accessing http.status in io/BrowserIO.js doLoad function throws js error NS_ERROR_NOT_AVAILABLE. doLoad could fix this by surrounding the entire first if statement in a try block.

doLoad () {
 try {
  if(http.status==200 || (location.protocol=="file:" && http.status==0)) {
   ...
  } else {
   ... }
 } catch (e) {
   var errObj = new dojo.io.Error("Server not responding");
   if( typeof kwArgs.error == "function" ) {
     kwArgs.error("error", errObj, http);
   }
 }
}

It might be more appropriate to implement this fix like this.

doLoad () {
 try { 
   var status = http.status;
 } catch (e) {
   var errObj = new dojo.io.Error("Server not responding");
   if( typeof kwArgs.error == "function" ) {
     kwArgs.error("error", errObj, http);
   }
   return;
 }

  if(status==200 || (location.protocol=="file:" && status==0)) {
   ...
  } else {
   ... }

}

Also, see ticket #196 (http://dojotoolkit.org/trac/ticket/196) for error callback bug.

Change History (1)

comment:1 Changed 14 years ago by Tom Trenka

Resolution: duplicate
Status: newclosed

This seems to have been fixed a while ago; eliminating as this is a dupe of #190.

Note: See TracTickets for help on using tickets.