Rename DatabaseSizeReached into MaxDatabaseSizeReached

This commit is contained in:
Kerollmops 2021-06-15 17:20:33 +02:00
parent 4eda438f6f
commit 8cfe3e1ec0
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
2 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,7 @@ pub enum FieldIdMapMissingEntry {
pub enum UserError {
AttributeLimitReached,
Csv(csv::Error),
DatabaseSizeReached,
MaxDatabaseSizeReached,
DocumentLimitReached,
FilterParsing(pest::error::Error<ParserRule>),
InvalidCriterionName { name: String },
@ -113,7 +113,7 @@ impl From<HeedError> 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"),

View File

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