mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
create an asc_desc error type that is never supposed to be returned to the end user
This commit is contained in:
parent
257e621d40
commit
86e272856a
3 changed files with 6 additions and 25 deletions
|
@ -56,8 +56,6 @@ pub enum FieldIdMapMissingEntry {
|
|||
pub enum UserError {
|
||||
AttributeLimitReached,
|
||||
DocumentLimitReached,
|
||||
InvalidAscDescSyntax { name: String },
|
||||
InvalidReservedAscDescSyntax { name: String },
|
||||
InvalidDocumentId { document_id: Value },
|
||||
InvalidFacetsDistribution { invalid_facets_name: HashSet<String> },
|
||||
InvalidFilter(pest::error::Error<ParserRule>),
|
||||
|
@ -226,22 +224,12 @@ impl fmt::Display for UserError {
|
|||
)
|
||||
}
|
||||
Self::InvalidFilter(error) => error.fmt(f),
|
||||
Self::InvalidAscDescSyntax { name } => {
|
||||
write!(f, "invalid asc/desc syntax for {}", name)
|
||||
}
|
||||
Self::InvalidGeoField { document_id, object } => write!(
|
||||
f,
|
||||
"the document with the id: {} contains an invalid _geo field: {}",
|
||||
document_id, object
|
||||
),
|
||||
Self::InvalidRankingRuleName { name } => write!(f, "invalid ranking rule {}", name),
|
||||
Self::InvalidReservedAscDescSyntax { name } => {
|
||||
write!(
|
||||
f,
|
||||
"{} is a reserved keyword and thus can't be used as a asc/desc rule",
|
||||
name
|
||||
)
|
||||
}
|
||||
Self::InvalidReservedRankingRuleName { name } => {
|
||||
write!(f, "{} is a reserved keyword and thus can't be used as a ranking rule", name)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue