Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3324 closed enhancement (fixed)

Better error message if v.in.wfs fails during networking

Reported by: marisn Owned by: grass-dev@…
Priority: minor Milestone: 7.4.0
Component: Vector Version: svn-trunk
Keywords: v.in.wfs Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Change History (4)

comment:1 Changed 4 years ago by marisn

Resolution: fixed
Status: newclosed

In 70823:

Move WFS import to urllib2 to provide better error messages. Fixes #3324

comment:2 Changed 4 years ago by neteler

.. we don't want this fix in 7.2.x?

comment:3 in reply to:  2 Changed 4 years ago by marisn

Replying to neteler:

.. we don't want this fix in 7.2.x?

Although we can backport a lot of things, is it necessary?

I added this one and few others to a list of potential backports for 7.2.2: https://trac.osgeo.org/grass/wiki/Grass7Planning#a7.2.2tobebackported

comment:4 Changed 4 years ago by neteler

In 71153:

v.in.wfs: Move WFS import to urllib2 to provide better error messages. Fixes #3324 (trunk, r70823)

Note: See TracTickets for help on using tickets.