Skip to content

Refine the error messages on saveObjects #583

@chloelbn

Description

@chloelbn

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions