-
Notifications
You must be signed in to change notification settings - Fork 82
Let the caller decide what kind of error they want to returns when parsing AscDesc
#342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it is the best solution, couldn't we introduce a new struct unit error instead, just for the AscDesc
syntax? i.e. struct InvalidAscDescSyntax
. We can then just do a text.to_string()
on the caller side?
How is a |
No, What I want is to create a custom error specific to this error instead of returning a |
Ah ok I get the idea thanks! |
ebf4a07
to
fa3729f
Compare
invalidCriterionName error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, merging! 🧛
bors merge
This is one possible fix for #339
We would then need to patch these lines https://github.com/meilisearch/MeiliSearch/blob/main/meilisearch-http/src/index/search.rs#L110-L114 to return the error we want.
Another solution would be to add a parameter to the
from_str
to specify which context we are in.