Jelajahi Sumber

r.in.wms crashes if server does not exist (see https://trac.osgeo.org/grass/ticket/3212)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69848 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 tahun lalu
induk
melakukan
47f8f94f34
1 mengubah file dengan 6 tambahan dan 3 penghapusan
  1. 6 3
      scripts/r.in.wms/wms_base.py

+ 6 - 3
scripts/r.in.wms/wms_base.py

@@ -6,7 +6,7 @@ List of classes:
  - wms_base::GRASSImporter
  - wms_base::WMSDriversInfo
 
-(C) 2012-2013 by the GRASS Development Team
+(C) 2012-2016 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -246,10 +246,13 @@ class WMSBase:
                     _("Authorization failed to <%s> when fetching capabilities") %
                     options['url'])
             else:
-                msg = _("Unable to fetch capabilities from <%s>: %s") % (options['url'], e)
+                msg = _("Unable to fetch capabilities from <{}>. Reason: ").format(
+                    options['url'])
 
                 if hasattr(e, 'reason'):
-                    msg += _("\nReason: ") + e.reason
+                    msg += '{}'.format(e.reason)
+                else:
+                    msg += '{}'.format(e)
 
                 grass.fatal(msg)