algolia/algoliasearch-client-php

Refine the error messages on saveObjects

Opened this issue · 0 comments

When you pass a single array instead of an array of objects to the saveObjects method, the following error is returned:
PHP Fatal error: Uncaught Algolia\AlgoliaSearch\Exceptions\MissingObjectId: All objects must have an unique objectID (like a primary key) to be valid.

The error should be changed to
PHP Fatal error: Please provide an array of objects instead of a single object. to better reflect the problem.

See https://secure.helpscout.net/conversation/950642494/173763/