create an asc_desc error type that is never supposed to be returned to the end user

This commit is contained in:
Tamo 2021-09-22 15:33:32 +02:00
parent 257e621d40
commit 86e272856a
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
3 changed files with 6 additions and 25 deletions

View file

@ -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)
}