Skip to content

Ensure the error handling are following the best practice #473

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

Closed
3 tasks done
brunoocasali opened this issue Aug 14, 2023 · 9 comments
Closed
3 tasks done

Ensure the error handling are following the best practice #473

brunoocasali opened this issue Aug 14, 2023 · 9 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 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 MeilisearchError

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

TODO:

  • Create a base error called MeilisearchError 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
@heysujal
Copy link

Hi @brunoocasali, I am new to this project and would like to work on this one. I recently learnt go basics, so I think this would be a good issue for me.

@heysujal
Copy link

heysujal commented Aug 26, 2023

@brunoocasali can you assign me this ?

@brunoocasali
Copy link
Member Author

Hi @heysujal

We prefer not assigning external people to our issues.
Because people often ask to be assigned and never return, which discourages other potential contributions.
We will accept and merge the first PR that fixes correctly and implements the issue.

@heysujal
Copy link

Hi @heysujal

We prefer not assigning external people to our issues. Because people often ask to be assigned and never return, which discourages other potential contributions. We will accept and merge the first PR that fixes correctly and implements the issue.

Understood

@heysujal
Copy link

heysujal commented Sep 2, 2023

Hi, I have not been able to figure it out like how to go about doing this.

@ja7ad
Copy link
Collaborator

ja7ad commented Dec 25, 2024

@brunoocasali I reviewed the error handling. The current implementation aligns well with common best practices, including structured error handling, contextual error messages, and integration with API-specific errors.

However, there is room for improvement in the future.

@curquiza
Copy link
Member

Thank you @ja7ad
Is it ok for you @ja7ad to close this issue and open new one more specific with the "room for improvements" you mention? Or do you think we don't need to open an issue yet? or should we let this current issue open?

@ja7ad
Copy link
Collaborator

ja7ad commented Dec 30, 2024

Thank you @ja7ad
Is it ok for you @ja7ad to close this issue and open new one more specific with the "room for improvements" you mention? Or do you think we don't need to open an issue yet? or should we let this current issue open?

I think it's okay.

@curquiza
Copy link
Member

Ok, so I close the issue ✅ feel free to open an new one with future improvements

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

4 participants