[GRASS-SVN] r55406 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 17 03:40:28 PDT 2013


Author: martinl
Date: 2013-03-17 03:40:28 -0700 (Sun, 17 Mar 2013)
New Revision: 55406

Modified:
   grass/trunk/lib/vector/Vlib/field.c
Log:
vlib: read_dblinks_ogr(): fatal error -> warning


Modified: grass/trunk/lib/vector/Vlib/field.c
===================================================================
--- grass/trunk/lib/vector/Vlib/field.c	2013-03-16 22:35:40 UTC (rev 55405)
+++ grass/trunk/lib/vector/Vlib/field.c	2013-03-17 10:40:28 UTC (rev 55406)
@@ -649,6 +649,7 @@
     return rule;
 }
 
+/* return -1 on error */
 static int read_dblinks_ogr(struct Map_info *Map)
 {
     struct dblinks *dbl;
@@ -670,9 +671,11 @@
 	
 	/* 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 @@
 	    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;
 	    }
 	}
     }



More information about the grass-commit mailing list