瀏覽代碼

Clarify the error message and add additional informations

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58885 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 11 年之前
父節點
當前提交
08a22ae624
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/python/pygrass/modules/interface/module.py

+ 3 - 2
lib/python/pygrass/modules/interface/module.py

@@ -242,8 +242,9 @@ class Module(object):
             # call the command with --interface-description
             # call the command with --interface-description
             get_cmd_xml = subprocess.Popen([cmd, "--interface-description"],
             get_cmd_xml = subprocess.Popen([cmd, "--interface-description"],
                                            stdout=subprocess.PIPE)
                                            stdout=subprocess.PIPE)
-        except OSError:
-            str_err = "Module %r not found, please check that the module exist"
+        except OSError as e:
+            print("OSError error({0}): {1}".format(e.errno, e.strerror))
+            str_err = "Error running: `%s --interface-description`."
             raise GrassError(str_err % self.name)
             raise GrassError(str_err % self.name)
         # get the xml of the module
         # get the xml of the module
         self.xml = get_cmd_xml.communicate()[0]
         self.xml = get_cmd_xml.communicate()[0]