From 799444da2c3f53287b8b934ed2e146ad5a3ce191 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 9 Aug 2006 13:11:24 +0000 Subject: [PATCH] throwing network exception on isXUL only since the OPAC will 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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/opac/common/js/RemoteRequest.js b/Open-ILS/web/opac/common/js/RemoteRequest.js index 48f3e0ab34..c43257ede2 100644 --- a/Open-ILS/web/opac/common/js/RemoteRequest.js +++ b/Open-ILS/web/opac/common/js/RemoteRequest.js @@ -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 = ''; 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; } -- 2.11.0