recreate most filter error except for the geosearch

This commit is contained in:
Tamo 2021-11-04 17:24:55 +01:00
parent 7328ffb034
commit 8234f9fdf3
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
4 changed files with 73 additions and 32 deletions

View file

@ -59,7 +59,7 @@ pub enum UserError {
InvalidDocumentId { document_id: Value },
InvalidFacetsDistribution { invalid_facets_name: HashSet<String> },
InvalidGeoField { document_id: Value, object: Value },
InvalidFilter { input: String },
InvalidFilter(String),
InvalidSortName { name: String },
InvalidSortableAttribute { field: String, valid_fields: HashSet<String> },
SortRankingRuleMissing,
@ -207,7 +207,7 @@ impl StdError for InternalError {}
impl fmt::Display for UserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::InvalidFilter { input } => write!(f, "parser error {}", input),
Self::InvalidFilter(input) => write!(f, "{}", input),
Self::AttributeLimitReached => f.write_str("maximum number of attributes reached"),
Self::CriterionError(error) => write!(f, "{}", error),
Self::DocumentLimitReached => f.write_str("maximum number of documents reached"),