meilisearch/meilisearch-rust

Use thiserror to handle errors

bidoubiwa opened this issue · 2 comments

⚠️ Do not start contributing to this issue before this PR is merged: #297

Currently we are implementing all our errors by hand.

Exemple:

impl From<MeilisearchError> for Error {
fn from(error: MeilisearchError) -> Self {
Self::Meilisearch(error)
}
}
impl From<jsonwebtoken::errors::Error> for Error {
fn from(error: jsonwebtoken::errors::Error) -> Error {
Error::InvalidTenantToken(error)
}
}

This would be way more simple using the thiserror library.

I can take this up.

Thanks for your interest in this project 🔥 You are definitely more than welcome to open a PR for this!

We prefer not assigning people to our issues because sometimes people ask to be assigned and never come back, which discourages the real volunteers contributors from opening a PR to fix this issue.
We will accept and merge the first PR that fixes correctly and well implements the issue following our contributing guidelines.

We are looking forward to reviewing your PR 😊