#3324: Better error message if v.in.wfs fails during networking
-------------------------+-------------------------
Reporter: marisn | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: minor | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Keywords: v.in.wfs | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
An example from #1586:
{{{
v.in.wfs url=http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap output=parks
}}}
will fail as there is no DNS entry for the FQDN. Still such error is not
reported by an error message but by a traceback:
{{{
Retrieving data...
Traceback (most recent call last):
File
"E:\OSGeo4W\apps\grass\grass-7.3.svn/scripts/v.in.wfs.py",
line 154, in <module>
main()
File
"E:\OSGeo4W\apps\grass\grass-7.3.svn/scripts/v.in.wfs.py",
line 123, in main
inf = urlopen(wfs_url)
File "E:\OSGeo4W\apps\Python27\lib\urllib.py", line 87, in
urlopen
return opener.open(url)
File "E:\OSGeo4W\apps\Python27\lib\urllib.py", line 208,
in open
return getattr(self, name)(url)
File "E:\OSGeo4W\apps\Python27\lib\urllib.py", line 345,
in open_http
h.endheaders(data)
File "E:\OSGeo4W\apps\Python27\lib\httplib.py", line 969,
in endheaders
self._send_output(message_body)
File "E:\OSGeo4W\apps\Python27\lib\httplib.py", line 829,
in _send_output
self.send(msg)
File "E:\OSGeo4W\apps\Python27\lib\httplib.py", line 791,
in send
self.connect()
File "E:\OSGeo4W\apps\Python27\lib\httplib.py", line 772,
in connect
self.timeout, self.source_address)
File "E:\OSGeo4W\apps\Python27\lib\socket.py", line 553,
in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno 11001] getaddrinfo
failed
}}}
Traceback should be replaced with more meaningfull error message.
In [changeset:"70823" 70823]:
{{{
#!CommitTicketReference repository="" revision="70823"
Move WFS import to urllib2 to provide better error messages. Fixes #3324
}}}