From 29fa9361a84a28260c929fedbeeb522c738ac33b Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Thu, 7 Jun 2007 18:16:03 +0000 Subject: [PATCH] Applying fredj's patch for #534, allowing Ajax exceptions to fall through and be rethrown if the Ajax object doesn't have an onException callback set. This should make Ajax errors a bit more obvious when they occur. git-svn-id: http://svn.openlayers.org/trunk/openlayers@3283 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Ajax.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Ajax.js b/lib/OpenLayers/Ajax.js index a15bc0a123..a75f8bf294 100644 --- a/lib/OpenLayers/Ajax.js +++ b/lib/OpenLayers/Ajax.js @@ -301,7 +301,14 @@ OpenLayers.Ajax.Request.prototype = OpenLayers.Class.inherit( OpenLayers.Ajax.Ba }, dispatchException: function(exception) { - (this.options.onException || OpenLayers.Ajax.emptyFunction)(this, exception); + if (this.options.onException) { + this.options.onException(this, exception); + } else { + // if we get here, Responders.dispatch('onException') will never + // be called. too bad. we should probably take out the Responders + // stuff anyway. + throw exception; + } OpenLayers.Ajax.Responders.dispatch('onException', this, exception); } });