#3212 closed defect (fixed)
r.in.wms crashes if server does not exist
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.0 |
Component: | Raster | Version: | svn-releasebranch72 |
Keywords: | r.in.wms | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
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.
Change History (4)
comment:1 by , 8 years ago
comment:4 by , 8 years ago
Fixed in all active branches, r.in.wms
reports
ERROR: Unable to fetch capabilities from <http://bla.bla/ms>. Reason: [Errno -2] Name or service not known
Note:
See TracTickets
for help on using tickets.
In 69848: