[GRASS-dev] [GRASS GIS] #3324: Better error message if v.in.wfs fails during networking

#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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3324&gt;
GRASS GIS <https://grass.osgeo.org>

#3324: Better error message if v.in.wfs fails during networking
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.wfs
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by marisn):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"70823" 70823]:
{{{
#!CommitTicketReference repository="" revision="70823"
Move WFS import to urllib2 to provide better error messages. Fixes #3324
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3324#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3324: Better error message if v.in.wfs fails during networking
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.wfs
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3324#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3324: Better error message if v.in.wfs fails during networking
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.wfs
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by marisn):

Replying to [comment:2 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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3324#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3324: Better error message if v.in.wfs fails during networking
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.wfs
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

In [changeset:"71153" 71153]:
{{{
#!CommitTicketReference repository="" revision="71153"
v.in.wfs: Move WFS import to urllib2 to provide better error messages.
Fixes #3324 (trunk, r70823)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3324#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>