mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-28 01:01:00 +00:00
Differentiate between document sort error and search sort error
This commit is contained in:
@ -168,6 +168,16 @@ pub enum SortError {
|
||||
ReservedNameForFilter { name: String },
|
||||
}
|
||||
|
||||
impl SortError {
|
||||
pub fn into_search_error(self) -> Error {
|
||||
Error::UserError(UserError::SortError { error: self, search: true })
|
||||
}
|
||||
|
||||
pub fn into_documents_error(self) -> Error {
|
||||
Error::UserError(UserError::SortError { error: self, search: false })
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AscDescError> for SortError {
|
||||
fn from(error: AscDescError) -> Self {
|
||||
match error {
|
||||
@ -190,12 +200,6 @@ impl From<AscDescError> for SortError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SortError> for Error {
|
||||
fn from(error: SortError) -> Self {
|
||||
Self::UserError(UserError::SortError(error))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use big_s::S;
|
||||
|
Reference in New Issue
Block a user