mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-12 07:58:54 +01:00
Makes the internal soft deleted error a UserError
This commit is contained in:
parent
eaf28b0628
commit
b61efd09fc
@ -27,8 +27,6 @@ pub enum Error {
|
|||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum InternalError {
|
pub enum InternalError {
|
||||||
#[error("Tried to access a soft deleted documents.")]
|
|
||||||
AccessingSoftDeletedDocument { document_id: DocumentId },
|
|
||||||
#[error("{}", HeedError::DatabaseClosing)]
|
#[error("{}", HeedError::DatabaseClosing)]
|
||||||
DatabaseClosing,
|
DatabaseClosing,
|
||||||
#[error("Missing {} in the {db_name} database.", key.unwrap_or("key"))]
|
#[error("Missing {} in the {db_name} database.", key.unwrap_or("key"))]
|
||||||
@ -85,6 +83,8 @@ pub enum FieldIdMapMissingEntry {
|
|||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum UserError {
|
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.")]
|
#[error("A document cannot contain more than 65,535 fields.")]
|
||||||
AttributeLimitReached,
|
AttributeLimitReached,
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
@ -959,7 +959,7 @@ impl Index {
|
|||||||
|
|
||||||
for id in ids {
|
for id in ids {
|
||||||
if soft_deleted_documents.contains(id) {
|
if soft_deleted_documents.contains(id) {
|
||||||
return Err(InternalError::AccessingSoftDeletedDocument { document_id: id })?;
|
return Err(UserError::AccessingSoftDeletedDocument { document_id: id })?;
|
||||||
}
|
}
|
||||||
let kv = self
|
let kv = self
|
||||||
.documents
|
.documents
|
||||||
|
Loading…
Reference in New Issue
Block a user