]> granicus.if.org Git - postgis/commitdiff
Emit a cancellation error code on GEOS interruptedExceptions, for consistency
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 7 May 2018 18:46:44 +0000 (18:46 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 7 May 2018 18:46:44 +0000 (18:46 +0000)
with internal interruptions.
References #4070

git-svn-id: http://svn.osgeo.org/postgis/trunk@16561 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos.c

index 82a3a1832d493842b7e90c7014b0e1728a8a3fb4..13c3cd51f36c8e467866590a382b110f055700de 100644 (file)
  * case we let PostgreSQL deal with the error.
  */
 #define HANDLE_GEOS_ERROR(label) { \
-  if ( ! strstr(lwgeom_geos_errmsg, "InterruptedException") ) \
-    lwpgerror(label": %s", lwgeom_geos_errmsg); \
+  if (strstr(lwgeom_geos_errmsg, "InterruptedException")) \
+    ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED), errmsg("canceling statement due to user request"))); \
+  else \
+    lwpgerror(label ": %s", lwgeom_geos_errmsg); \
   PG_RETURN_NULL(); \
 }