Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing ElasticSearch errors to InstantSearch #1257

Open
McManning opened this issue Apr 17, 2023 · 1 comment
Open

Exposing ElasticSearch errors to InstantSearch #1257

McManning opened this issue Apr 17, 2023 · 1 comment

Comments

@McManning
Copy link
Contributor

The problem

It'd be nice if errors raised from ElasticSearch would bubble up in some way to the InstantSearch state so that we can provide better feedback to the user as to why something failed. Otherwise, one of the InstantSearch filter/facet components ends up throwing a generic "Cannot convert undefined or null to object" when dealing with bad results.

Environment

  • Searchkit version (or git revision) that exhibits the issue: v4

Details

One good place to add support would be in performSearch where backend errors are just logged to the console.

It looks like InstantSearch does support catching errors from downstream components via middleware (see: https://www.algolia.com/doc/guides/building-search-ui/going-further/conditional-display/react-hooks/#handling-errors) so it might be possible that simply throwing an error could be caught and handled.

@joemcelroy
Copy link
Member

Could you find out the error structure? Happy for you to do a PR fix for this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants