diff --git a/milli/src/error.rs b/milli/src/error.rs new file mode 100644 index 000000000..02740377c --- /dev/null +++ b/milli/src/error.rs @@ -0,0 +1,42 @@ +use std::io; + +use crate::{DocumentId, FieldId}; + +pub enum Error { + InternalError(InternalError), + IoError(io::Error), + UserError(UserError), +} + +pub enum InternalError { + DatabaseMissingEntry(DatabaseMissingEntry), + FieldIdMapMissingEntry(FieldIdMapMissingEntry), + IndexingMergingKeys(IndexingMergingKeys), +} + +pub enum IndexingMergingKeys { + DocIdWordPosition, + Document, + MainFstDeserialization, + WordLevelPositionDocids, + WordPrefixLevelPositionDocids, +} + +pub enum FieldIdMapMissingEntry { + DisplayedFieldId { field_id: FieldId }, + DisplayedFieldName { field_name: String }, + FacetedFieldName { field_name: String }, + FilterableFieldName { field_name: String }, + SearchableFieldName { field_name: String }, +} + +pub enum DatabaseMissingEntry { + DocumentId { internal_id: DocumentId }, + FacetValuesDocids, + IndexCreationTime, + IndexUpdateTime, +} + +pub enum UserError { + +} diff --git a/milli/src/lib.rs b/milli/src/lib.rs index 8c1ed514c..b7401330a 100644 --- a/milli/src/lib.rs +++ b/milli/src/lib.rs @@ -1,6 +1,7 @@ #[macro_use] extern crate pest_derive; mod criterion; +mod error; mod external_documents_ids; mod fields_ids_map; mod search;