浏览代码

vlib: read_dblinks_ogr(): fatal error -> warning

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55406 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父节点
当前提交
6cad7decab
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      lib/vector/Vlib/field.c

+ 9 - 5
lib/vector/Vlib/field.c

@@ -649,6 +649,7 @@ static int read_dblinks_nat(struct Map_info *Map)
     return rule;
 }
 
+/* return -1 on error */
 static int read_dblinks_ogr(struct Map_info *Map)
 {
     struct dblinks *dbl;
@@ -670,9 +671,11 @@ static int read_dblinks_ogr(struct Map_info *Map)
 	
 	/* data source handle */
 	Map->fInfo.ogr.ds = OGROpen(Map->fInfo.ogr.dsn, FALSE, NULL);
-	if (Map->fInfo.ogr.ds == NULL)
-	    G_fatal_error(_("Unable to open OGR data source '%s'"),
-			  Map->fInfo.ogr.dsn);
+	if (Map->fInfo.ogr.ds == NULL) {
+            G_warning(_("Unable to open OGR data source '%s'"),
+                      Map->fInfo.ogr.dsn);
+            return -1;
+        }
     }
     if (Map->fInfo.ogr.layer == NULL) {
 	/* get layer number */
@@ -686,8 +689,9 @@ static int read_dblinks_ogr(struct Map_info *Map)
 	    if (Map->fInfo.ogr.layer == NULL) {
 		OGR_DS_Destroy(Map->fInfo.ogr.ds);
 		Map->fInfo.ogr.ds = NULL;
-		G_fatal_error(_("Unable to open OGR layer <%s>"),
-			      Map->fInfo.ogr.layer_name);
+		G_warning(_("Unable to open OGR layer <%s>"),
+                          Map->fInfo.ogr.layer_name);
+                return -1;
 	    }
 	}
     }