class Geocoder::Lookup::Yahoo

def parse_raw_data(raw_data)


to warning message.
Yahoo auth errors can also be cryptic, so add raw error desc
(which would add unnecessary complexity).
Handle that here, without parsing the XML
Yahoo returns errors as XML even when JSON format is specified.
#
def parse_raw_data(raw_data)
  if raw_data.match(/^<\?xml/)
    if raw_data.include?("Rate Limit Exceeded")
      raise_error(Geocoder::OverQueryLimitError) || Geocoder.log(:warn, "Over API query limit.")
    elsif raw_data =~ /<yahoo:description>(Please provide valid credentials.*)<\/yahoo:description>/i
      raise_error(Geocoder::InvalidApiKey) || Geocoder.log(:warn, "Invalid API key. Error response: #{$1}")
    end
  else
    super(raw_data)
  end
end