mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 13:10:06 +01:00
2b2e571c76
2460: Create custom error types for `TaskType`, `TaskStatus`, and `IndexUid` r=Kerollmops a=walterbm # Pull Request ## What does this PR do? Fixes #2443 by making the following changes: - Add custom `TaskTypeError` for `TaskType::from_str` - Add custom `TaskStatusError` for `TaskStatus::from_str` - Add custom `IndexUidFormatError` for `IndexUid::from_str` - Implement `From<IndexUidFormatError> for IndexResolverError` to convert between errors - Replace all usages of `IndexUid::new` with `IndexUid::from_str` - **NOTE** I am relatively new to Rust and I struggled a lot with this final part. This PR ended up with a messy error conversion which does not seem ideal. Please let me know if you have any suggestions for how to make this better and I'll be happy to make any updates! ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: walter <walter.beller.morales@gmail.com>