<div dir="ltr">Patrick,<div><br></div><div>Thanks for your reply. I was hoping to find a less involved way, but if that's what I need to do I guess I'll do it!</div><div><br></div><div>Thanks so much,</div><div>Joshua Chamberlain</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 6:06 PM, P O'Toole <span dir="ltr"><<a href="mailto:P.OToole@uwyo.edu" target="_blank">P.OToole@uwyo.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Josh<br>
<span class=""><br>
>Hello,<br>
<br>
>My app allows users to write their own SQL, and I'd like to show them all<br>
>error messages directly pertaining to their query, while hiding system<br>
>errors, etc. It seems that all PostGIS errors, however, have the same<br>
>generic error code: XX000 Internal Error. For example:<br>
<br>
>SQLSTATE[XX000]: Internal error: 7 ERROR:  Operation on mixed SRID<br>
>geometries<br>
<br>
>Is there a way to identify an error as coming from PostGIS, other than<br>
>assuming that all internal errors are from PostGIS?<br>
<br>
</span>I'm not sure there's a separate, formally-maintained list of all PostGIS errors your users might encounter. Your best bet is probably to look at the PostGIS source and see how errors are being generated there. They may or may not all be neatly collected in one place as opposed to being constructed on-the-fly. Either way, you should be able to generate a list of error-message formats for your installed version of PostGIS and add some handling logic in your application when it looks like something from PostGIS is bubbling.<br>
<br>
Cheers<br>
- Patrick O'Toole<br>
<br>
Application Developer<br>
Wyoming Natural Diversity Database<br>
UW Berry Biodiversity Conservation Center<br>
Department 3381, 1000 E. University Av.<br>
Laramie, WY 82071<br>
P: <a href="tel:307-766-3018" value="+13077663018">307-766-3018</a><br>
<br>
<br>
</blockquote></div><br></div></div>