While debugging a custom resource, I was incorrectly constructing my query causing an exception to be raised in services_resource_execute_index_query(). However, the exception handling code raised this exception:
Call to undefined method PDOException::message() in PATH_TO_MY_DRUPAL_INSTALL/s
ites/default/modules/contrib/services/services.module on line 555
I believe that this can be fixed by changing line 555 of services.module to read:
return services_error(t('Invalid query provided, double check that the fields and parameters you defined are correct and exist. ' . $e->getMessage()), 406);
i.e. changing $e->message() to $e->getMessage()
Comments
Comment #1
marcingy commentedAnd here it is a patch
Comment #3
marcingy commented#1: pdo_error.patch queued for re-testing.
Comment #5
marcingy commentedNew combined patch from #1473438: index query code deals poorly with PDOExceptions.
Comment #6
marcingy commentedCommitted as this was just a re-roll from the other issue
Comment #7.0
(not verified) commentedClarified my suggested fix.