<div>What is a good way to get user defined exceptions, written inside of postrges function to be reflected to the end user?</div><div><br></div><div><br></div><div>Say I have an item table in a database and it has a unique &#39;name&#39; column.</div>
<div><br></div><div>When I call my &#39;create_item&#39; function in the postgres database, and the name given conflicts with an existing row in that table, I would like the exception returned to be &#39;that name already exists&#39; and then pass that message through my web interface down to the user.</div>
<div><br></div><div><br></div><div>Of course other types of exceptions, that I didn&#39;t anticipate, don&#39;t ultimately get sent to my client and they just see an &quot;OOPS!&quot; message.</div><div><br></div><div><br>
</div><div>This sort of extends the principal that racket has of &quot;raise-user-error&quot; being different than &quot;raise&quot; in racket, and applying that concept down inside of postgres functions... (which the racket database library can follow through with in its own runtime environment)</div>
<div><br></div><div><br></div><div>Thanks,</div><div>    Curtis</div><div><br></div><div><br></div><div><br></div><div><br></div>