Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Provide a sort error handler #371

Merged
merged 2 commits into from
Sep 28, 2021
Merged

Provide a sort error handler #371

merged 2 commits into from
Sep 28, 2021

Conversation

irevoire
Copy link
Member

This PR simplify the error handling of asc-desc rules for Meilisearch or any other wrapper by providing directly in milli a new error type called SortError that can be generated from an AscDescError and that can be automatically converted to a UserError.

Basically now, wherever you are in the code as a user or in milli you can parse an AscDesc syntax and depending on the context, cast it either as a SortError or a CriterionError in one line with improved error messages.

@irevoire irevoire requested a review from Kerollmops September 28, 2021 09:20
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, indeed, helps a lot and makes the code clearer.
Thank you!

bors merge

@bors
Copy link
Contributor

bors bot commented Sep 28, 2021

@bors bors bot merged commit 3b47994 into main Sep 28, 2021
@bors bors bot deleted the sort_error_handler branch September 28, 2021 10:01
@irevoire irevoire added the DB breaking The related changes break the DB label Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DB breaking The related changes break the DB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants