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

Ensure the error handling are following the best practice #346

Open
3 tasks
brunoocasali opened this issue Aug 14, 2023 · 2 comments
Open
3 tasks

Ensure the error handling are following the best practice #346

brunoocasali opened this issue Aug 14, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@brunoocasali
Copy link
Member

brunoocasali commented Aug 14, 2023

⚠️ This issue is generated, it means the examples and the namings do not necessarily correspond to the language of this repository.
Also, if you are a maintainer, please add any clarification and instructions about this issue.

Sorry if this is already wholly/partially implemented. Feel free to let me know about the state of this issue in the repo.

Related to meilisearch/integration-guides#267


⚠️ For more information, check meilisearch/integration-guides#267

Ensure this SDK follows the following guidelines:

  • All the errors > 400 without a message should be sent as MeilisearchCommunicationError
  • Know errors like index is not found, or mistakes in the request like not-allowed params should be sent as MeilisearchApiError
  • Any other error should be a MeilisearchException

Essentially all the error should extend from MeilisearchException, the consumers should have a way to catch all the errors.
Let us know if this is unclear or you have a better idea!

TODO:

  • Create a base error called MeilisearchException which will extend the standard error if it does not exist (when the language supports)
  • Make all the other errors extend this error.
  • Move all errors without message to MeilisearchCommunicationError since it is not a Meilisearch error anyway.
@brunoocasali brunoocasali added good first issue Good for newcomers enhancement New feature or request labels Aug 14, 2023
@ahmednfwela
Copy link
Collaborator

@brunoocasali I suggest making it MeilisearchException instead of MeilisearchError

@brunoocasali
Copy link
Member Author

Done! @ahmednfwela

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants