throwing network failure object instead of string
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Aug 2006 15:06:43 +0000 (15:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Aug 2006 15:06:43 +0000 (15:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5330 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 63a2183..fbe19f1 100644 (file)
@@ -2,6 +2,18 @@ var XML_HTTP_GATEWAY = "gateway";
 var XML_HTTP_SERVER = "";
 var XML_HTTP_MAX_TRIES = 3;
 
+
+
+function NetworkFailure(stat) {
+       self.status = stat;
+}
+
+NetworkFailure.prototype.status = function() {
+       return self.status;
+}
+
+
+
 //var IAMXUL = false;
 function isXUL() { try { if(IAMXUL) return true;}catch(e){return false;}; }
 
@@ -256,8 +268,9 @@ RemoteRequest.prototype.getResultObject = function() {
 
        try {
                if( this.xmlhttp.status != 200 ) {
-                       try{dump('! NETWORK FAILURE.  HTTP STATUS = ' + this.xmlhttp.status);}catch(e){}
-                       throw 'NETWORK FAILURE';
+                       try{dump('! NETWORK FAILURE.  HTTP STATUS = ' 
+                               + this.xmlhttp.status);}catch(e){}
+                       throw new NetworkFailure(this.xmlhttp.status);
                }
        } catch(e) {}