code: function(data) {
          var ret = null; 
          
          if (!data) {
              ret = (this.response.error !== '');
          } else {
              data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
              var errorNodes = data.documentElement.getElementsByTagName("ERROR");
              ret = (errorNodes !== null && errorNodes.length > 0);
          }
  
          return ret;
      }
docs: APIMethod: iserror
  Check to see if the response from the server was an error.
  
  Parameters:
  data - {String} or {DOMElement} data to read/parse. If nothing is supplied,
  the current response is examined.
  
  Returns:
  {Boolean} true if the response was an error.