if (isQuery) {
// For queries with an invalid ID field message, treat them
// just like any other query for which we have no results.
String exceptionMsg = af.getExceptionMessage();
if (exceptionMsg != null && exceptionMsg.contains("invalid ID field")) {
return new NoQueryResultsException("invalid ID field");
}
return new NucleusUserException(af.toString(), af);
} else {
// For non-queries (e.g. em.find), the SOQL query is pre-defined