瀏覽代碼

wxGUI: show error when creating db

Previously traceback went to command line.
Typical errors are Permission denied and No such file or dir
(mkdir creates only last item on the path).


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71306 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 8 年之前
父節點
當前提交
70f251e00d
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      gui/wxpython/location_wizard/wizard.py

+ 7 - 1
gui/wxpython/location_wizard/wizard.py

@@ -2566,7 +2566,13 @@ class LocationWizard(wx.Object):
             # change to new GISDbase or create new one
             if os.path.isdir(database) != True:
                 # create new directory
-                os.mkdir(database)
+                try:
+                    os.mkdir(database)
+                except OSError as error:
+                    GError(parent=self.wizard, message="%s <%s>" %
+                           (_("Unable to create new GRASS Database"),
+                           database))
+                    return None
 
             # change to new GISDbase directory
             RunCommand('g.gisenv',