algolia / algolia/algoliasearch-client-php

Refine the error messages on saveObjects

Open
#583 0 comments 2 reactions 0 assignees View on GitHub
Bug
Dominant language
PHP
Stars
697
Forks
112
PR merge metrics
No merged PRs in 30d

Description

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/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.