/* Uh oh! Exception thrown at construction... */
if ( ! g )
{
- lwerror("One of the geometries in the set "
- "could not be converted to GEOS: %s", lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("One of the geometries in the set "
+ "could not be converted to GEOS");
PG_RETURN_NULL();
}
GEOSGeom_destroy(g);
if ( ! g_union )
{
- lwerror("GEOSUnaryUnion: %s",
- lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("GEOSUnaryUnion");
PG_RETURN_NULL();
}
if ( 0 == g ) /* exception thrown at construction */
{
/* TODO: release GEOS allocated memory ! */
- lwerror("One of the geometries in the set "
- "could not be converted to GEOS: %s", lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("One of the geometries in the set "
+ "could not be converted to GEOS");
PG_RETURN_NULL();
}
geoms[curgeom] = g;
GEOSGeom_destroy(g1);
if ( ! g2 )
{
- lwerror("GEOSUnionCascaded: %s",
- lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("GEOSUnionCascaded");
PG_RETURN_NULL();
}
if ( 0 == g1 ) /* exception thrown at construction */
{
/* TODO: release GEOS allocated memory ! */
- lwerror("First argument geometry could not be converted to GEOS: %s",
- lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("First argument geometry could not be converted to GEOS");
PG_RETURN_NULL();
}
if ( 0 == g1 ) /* exception thrown at construction */
{
+ /* Why is this a WARNING rather than an error ? */
+ /* TODO: use HANDLE_GEOS_ERROR instead */
elog(WARNING, "GEOSPointOnSurface(): %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
GEOSGeom_destroy((GEOSGeometry *)g1);
if (reason_str == NULL)
{
- elog(ERROR,"GEOSisValidReason() threw an error: %s", lwgeom_geos_errmsg);
+ HANDLE_GEOS_ERROR("GEOSisValidReason");
PG_RETURN_NULL(); /* never get here */
}
result = cstring2text(reason_str);