diff --git a/milli/src/error.rs b/milli/src/error.rs index a9c2add24..294b2aa57 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -51,7 +51,7 @@ pub enum FieldIdMapMissingEntry { pub enum UserError { AttributeLimitReached, Csv(csv::Error), - DatabaseSizeReached, + MaxDatabaseSizeReached, DocumentLimitReached, FilterParsing(pest::error::Error), InvalidCriterionName { name: String }, @@ -113,7 +113,7 @@ impl From for Error { match error { HeedError::Io(error) => Error::from(error), - HeedError::Mdb(MdbError::MapFull) => UserError(DatabaseSizeReached), + HeedError::Mdb(MdbError::MapFull) => UserError(MaxDatabaseSizeReached), HeedError::Mdb(MdbError::Invalid) => UserError(InvalidStoreFile), HeedError::Mdb(error) => InternalError(Store(error)), HeedError::Encoding => InternalError(Serialization(Encoding { db_name: None })), @@ -211,7 +211,7 @@ impl fmt::Display for UserError { write!(f, "document doesn't have an identifier {}", json) }, Self::MissingPrimaryKey => f.write_str("missing primary key"), - Self::DatabaseSizeReached => f.write_str("database size reached"), + Self::MaxDatabaseSizeReached => f.write_str("maximum database size reached"), // TODO where can we find it instead of writing the text ourselves? Self::NoSpaceLeftOnDevice => f.write_str("no space left on device"), Self::InvalidStoreFile => f.write_str("store file is not a valid database file"), diff --git a/milli/src/search/facet/filter_condition.rs b/milli/src/search/facet/filter_condition.rs index 98d638574..6d99bb977 100644 --- a/milli/src/search/facet/filter_condition.rs +++ b/milli/src/search/facet/filter_condition.rs @@ -164,7 +164,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let (lresult, _) = pest_parse(items.next().unwrap()); let (rresult, _) = pest_parse(items.next().unwrap()); @@ -183,7 +183,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let value = items.next().unwrap(); let (result, svalue) = pest_parse(value); @@ -200,7 +200,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let value = items.next().unwrap(); let (result, _svalue) = pest_parse(value); @@ -217,7 +217,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let value = items.next().unwrap(); let (result, _svalue) = pest_parse(value); @@ -234,7 +234,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let value = items.next().unwrap(); let (result, _svalue) = pest_parse(value); @@ -251,7 +251,7 @@ impl FilterCondition { { let mut items = item.into_inner(); let fid = field_id(fields_ids_map, filterable_fields, &mut items) - .map_err(UserError::FilterParsing)?; + .map_err(UserError::InvalidFilterAttribute)?; let value = items.next().unwrap(); let (result, _svalue) = pest_parse(value);