OpenLayers OpenLayers

Changeset 3283

Show
Ignore:
Timestamp:
06/07/07 14:16:03 (1 year ago)
Author:
sderle
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Ajax.js

    r3205 r3283  
    302302 
    303303  dispatchException: function(exception) { 
    304     (this.options.onException || OpenLayers.Ajax.emptyFunction)(this, exception); 
     304    if (this.options.onException) { 
     305        this.options.onException(this, exception); 
     306    } else { 
     307        // if we get here, Responders.dispatch('onException') will never 
     308        // be called. too bad. we should probably take out the Responders 
     309        // stuff anyway. 
     310        throw exception; 
     311    } 
    305312    OpenLayers.Ajax.Responders.dispatch('onException', this, exception); 
    306313  }