[GRASS-dev] [GRASS GIS] #3212: r.in.wms crashes if server does not exist

GRASS GIS trac at osgeo.org
Wed Nov 16 23:35:10 PST 2016


#3212: r.in.wms crashes if server does not exist
-------------------------+---------------------------------
 Reporter:  neteler      |      Owner:  grass-dev@…
     Type:  defect       |     Status:  new
 Priority:  normal       |  Milestone:  7.2.0
Component:  Raster       |    Version:  svn-releasebranch72
 Keywords:  r.in.wms     |        CPU:  Unspecified
 Platform:  Unspecified  |
-------------------------+---------------------------------
 Since free WMS services come and go, the script should not crash if a OWS
 server does not exist (likely "easy" to try/except):

 Here a test case:

 {{{
 nslookup bla.bla/ms
 ...
 ** server can't find bla.bla/ms: NXDOMAIN

 # using script with non-existing WMS server:
 r.in.wms -c url="http://bla.bla/ms"
 Traceback (most recent call last):
   File "/home/mundialis/software/grass72_svn/dist.x86_64-pc-linux-
 gnu/scripts/r.in.wms", line 236, in <module>
     sys.exit(main())
   File "/home/mundialis/software/grass72_svn/dist.x86_64-pc-linux-
 gnu/scripts/r.in.wms", line 218, in main
     wms.GetCapabilities(options)
   File "/home/mundialis/software/grass72_svn/dist.x86_64-pc-linux-
 gnu/etc/r.in.wms/wms_base.py", line 275, in GetCapabilities
     cap = self._fetchCapabilities(options)
   File "/home/mundialis/software/grass72_svn/dist.x86_64-pc-linux-
 gnu/etc/r.in.wms/wms_base.py", line 252, in _fetchCapabilities
     msg += _("\nReason: ") + e.reason
 TypeError: cannot concatenate 'str' and 'gaierror' objects
 }}}

 A "Server not found" message would be appreciated in such case.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3212>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list