throwing network exception on isXUL only since the OPAC will
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 13:11:24 +0000 (13:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 13:11:24 +0000 (13:11 +0000)
get the exception just by navigating to a new page while
requests are still out

git-svn-id: svn://svn.open-ils.org/ILS/trunk@5400 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/RemoteRequest.js

index 48f3e0a..c43257e 100644 (file)
@@ -5,10 +5,15 @@ var XML_HTTP_MAX_TRIES = 3;
 
 
 /* This object is thrown when network failures occur */
-function NetworkFailure(stat) { this._status = stat; }
+function NetworkFailure(stat, url) { 
+       this._status = stat; 
+       this._url = url;
+}
+
 NetworkFailure.prototype.status = function() { return this._status; }
+NetworkFailure.prototype.url = function() { return this._url; }
 NetworkFailure.prototype.toString = function() { 
-       return "Network Failure: status = " + this.status(); 
+       return "Network Failure: status = " + this.status() +'\n'+this.url()
 }
 
 
@@ -276,7 +281,9 @@ RemoteRequest.prototype.getResultObject = function() {
        if( failed ) {
                if(!status) status = '<unknown>';
                try{dump('! NETWORK FAILURE.  HTTP STATUS = ' +status);}catch(e){}
-               throw new NetworkFailure(status);
+               if(isXUL()) 
+                       throw new NetworkFailure(status, this.param_string);
+               else return null;
        }