diff --git a/milli/src/error.rs b/milli/src/error.rs index b151e5545..57ae1c85a 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -27,8 +27,6 @@ pub enum Error { #[derive(Error, Debug)] pub enum InternalError { - #[error("Tried to access a soft deleted documents.")] - AccessingSoftDeletedDocument { document_id: DocumentId }, #[error("{}", HeedError::DatabaseClosing)] DatabaseClosing, #[error("Missing {} in the {db_name} database.", key.unwrap_or("key"))] @@ -85,6 +83,8 @@ pub enum FieldIdMapMissingEntry { #[derive(Error, Debug)] pub enum UserError { + #[error("A soft deleted internal document id have been used: `{document_id}`.")] + AccessingSoftDeletedDocument { document_id: DocumentId }, #[error("A document cannot contain more than 65,535 fields.")] AttributeLimitReached, #[error(transparent)] diff --git a/milli/src/index.rs b/milli/src/index.rs index 9ada51170..9637b4103 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -959,7 +959,7 @@ impl Index { for id in ids { if soft_deleted_documents.contains(id) { - return Err(InternalError::AccessingSoftDeletedDocument { document_id: id })?; + return Err(UserError::AccessingSoftDeletedDocument { document_id: id })?; } let kv = self .documents