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

A basic error handler #149

Closed
alallema opened this issue May 26, 2021 · 4 comments · Fixed by #158
Closed

A basic error handler #149

alallema opened this issue May 26, 2021 · 4 comments · Fixed by #158
Assignees

Comments

@alallema
Copy link
Contributor

Create a basic error handler, with these 3 custom errors:

  • MeiliSearchApiError
  • MeiliSearchCommunicationError
  • MeiliSearchTimeoutError

MeiliSearch API has an error handler, and returns this kind of JSON when an error is found:

{
  "message": "Index movies not found",
  "errorCode": "index_not_found",
  "errorType": "invalid_request_error",
  "errorLink": "https://docs.meilisearch.com/errors#index_not_found"
}

The complete list of errorCode is available in the documentation

It could be great to let the user access message, errorCode, errorType and errorLink to a better understanding an error.

@lewisreay
Copy link

👋 @alallema I can work on this if you want?

@alallema
Copy link
Contributor Author

alallema commented Jun 7, 2021

Hi @lewisreay !
Thanks a lot for this proposition. For now, I'm working on a big refactor of the code and I think this issue will probably be done internally.
However, don't worry there will be new issues available soon. Thanks again for your support.

@lewisreay
Copy link

No problem, thanks, @alallema! Looking forward to the new engine and refactor.

@curquiza
Copy link
Member

@alallema, in the GetOrCreateIndex method, you must check the error is index_not_found once the error handler is implemented 😄

@alallema alallema linked a pull request Jun 23, 2021 that will close this issue
@bors bors bot closed this as completed in f43e1d3 Jun 29, 2021
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

Successfully merging a pull request may close this issue.

3 participants