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
This commit is contained in:
Schuyler Erle
2007-06-07 18:16:03 +00:00
parent 22c8e3ded4
commit 29fa9361a8

View File

@@ -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);
}
});