[postgis-users] Programmatically identify PostGIS errors?

Joshua Chamberlain josh at zephyri.co
Wed Feb 8 11:01:59 PST 2017


Hello,

My app allows users to write their own SQL, and I'd like to show them all
error messages directly pertaining to their query, while hiding system
errors, etc. It seems that all PostGIS errors, however, have the same
generic error code: XX000 Internal Error. For example:

SQLSTATE[XX000]: Internal error: 7 ERROR:  Operation on mixed SRID
geometries

Is there a way to identify an error as coming from PostGIS, other than
assuming that all internal errors are from PostGIS?

Thanks,
Joshua Chamberlain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170208/4fe8d8ac/attachment.html>


More information about the postgis-users mailing list