]> granicus.if.org Git - postgis/commitdiff
Handle error from WithinDistance2D liblwgeom-topo backend callbacks
authorSandro Santilli <strk@keybit.net>
Mon, 29 Jun 2015 07:01:59 +0000 (07:01 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 29 Jun 2015 07:01:59 +0000 (07:01 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13733 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_topo.c

index 75313f19fc06371d8d5c0cb04faef29eb79c2208..2b7d5a46fd1b262b3162a2b8acd10d7b2d32aa8b 100644 (file)
@@ -173,13 +173,17 @@ lwt_be_updateTopoGeomEdgeSplit(LWT_TOPOLOGY* topo, LWT_ELEMID split_edge, LWT_EL
   CBT3(topo, updateTopoGeomEdgeSplit, split_edge, new_edge1, new_edge2);
 }
 
-/* wrappers of be wrappers... */
+/* wrappers of backend wrappers... */
 
 int
 lwt_be_ExistsCoincidentNode(LWT_TOPOLOGY* topo, LWPOINT* pt)
 {
   int exists = 0;
   lwt_be_getNodeWithinDistance2D(topo, pt, 0, &exists, 0, -1);
+  if ( exists == -1 ) {
+    lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface));
+    return 0;
+  }
   return exists;
 }
 
@@ -188,6 +192,10 @@ lwt_be_ExistsEdgeIntersectingPoint(LWT_TOPOLOGY* topo, LWPOINT* pt)
 {
   int exists = 0;
   lwt_be_getEdgeWithinDistance2D(topo, pt, 0, &exists, 0, -1);
+  if ( exists == -1 ) {
+    lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface));
+    return 0;
+  }
   return exists;
 }