URLError exception from urllib not caught

Bug #1157056 reported by Vanessa Lee on 2013-03-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yii GeoCoder Extension
Undecided
Unassigned

Bug Description

If you don't have net access you get an exception thrown from urllib2 that isn't caught in pygeocoder.

  File "/usr/local/lib/python2.6/dist-packages/pygeocoder.py", line 261, in geocode
    return GeocoderResult(Geocoder.getdata(params=params))
  File "/usr/local/lib/python2.6/dist-packages/pygeocoder.py", line 219, in getdata
    response = urllib2.urlopen(request)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1172, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1147, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers