All API functions return a structure containing a rescode (result code)
and resmsg (result message).
Any non-zero rescode is treated as an error, and most client libraries
convert these to exceptions which your application might catch.
This reference provides a comprehensive list of known rescodes.