Exception handling the correct way

Michal Seidl michal.seidl at gmail.com
Sun Mar 10 10:19:48 PDT 2024


Hello,
may be I did not say it clearly enough. I mean how to catch from 
programing language code. PHP, Python, ...

To look in log is not the right way I guess.

Michal

On 3/10/24 16:01, 5P0CK wrote:
> The postgres log is where I look for details on errors
> 
> Jakob
> 
> søn. 10. mar. 2024 14.55 skrev Michal Seidl <michal.seidl at gmail.com 
> <mailto:michal.seidl at gmail.com>>:
> 
>     Hello,
>     is there any standard way how to catch Exceptions from Postgis
>     functions?
> 
>     For Example:
>     SELECT ST_Split(polygon_geom, polygon_geom)
> 
>     result in general PostgreSQL InternalError exception with CODE XX000.
> 
>     This is not very helpful to catch such specific error. It seem to me
>     that also any other errors raise this general InternalError. The only
>     way seems to read exception message, but is this the right way?
> 
>     How to distinguish between different errors? I can not find anything in
>     Postgis documentation https://postgis.net/docs/manual-3.4/
>     <https://postgis.net/docs/manual-3.4/>
> 
>     Thanks Michal S.
> 


More information about the postgis-users mailing list