The iPhone Client Object API supports exception classes for queries and for the messaging client.
Query Exception Classes
Exceptions thrown by SUPStatementBuilder when building an SUPQuery, or by SUPQueryResultSet during processing of the results. These exceptions occur if the query called for an entity or attribute that does not exist, or tried to access results with the wrong datatype.