From: erickson Date: Mon, 7 Aug 2006 15:06:43 +0000 (+0000) Subject: throwing network failure object instead of string X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cddb191d317ef0697870a4d06a732375c91d8efb;p=Evergreen.git throwing network failure object instead of string git-svn-id: svn://svn.open-ils.org/ILS/trunk@5330 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/common/js/RemoteRequest.js b/Open-ILS/web/opac/common/js/RemoteRequest.js index 63a2183507..fbe19f1951 100644 --- a/Open-ILS/web/opac/common/js/RemoteRequest.js +++ b/Open-ILS/web/opac/common/js/RemoteRequest.js @@ -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) {}