mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-04 20:18:55 +01:00
Add a new Error for when a user use a non-filtered attribute in a filter
This commit is contained in:
parent
713acc408b
commit
4eda438f6f
@ -56,6 +56,7 @@ pub enum UserError {
|
|||||||
FilterParsing(pest::error::Error<ParserRule>),
|
FilterParsing(pest::error::Error<ParserRule>),
|
||||||
InvalidCriterionName { name: String },
|
InvalidCriterionName { name: String },
|
||||||
InvalidDocumentId { document_id: Value },
|
InvalidDocumentId { document_id: Value },
|
||||||
|
InvalidFilterAttribute(pest::error::Error<ParserRule>),
|
||||||
InvalidStoreFile,
|
InvalidStoreFile,
|
||||||
MissingDocumentId { document: Object },
|
MissingDocumentId { document: Object },
|
||||||
MissingPrimaryKey,
|
MissingPrimaryKey,
|
||||||
@ -204,6 +205,7 @@ impl fmt::Display for UserError {
|
|||||||
let json = serde_json::to_string(document_id).unwrap();
|
let json = serde_json::to_string(document_id).unwrap();
|
||||||
write!(f, "document identifier is invalid {}", json)
|
write!(f, "document identifier is invalid {}", json)
|
||||||
},
|
},
|
||||||
|
Self::InvalidFilterAttribute(error) => error.fmt(f),
|
||||||
Self::MissingDocumentId { document } => {
|
Self::MissingDocumentId { document } => {
|
||||||
let json = serde_json::to_string(document).unwrap();
|
let json = serde_json::to_string(document).unwrap();
|
||||||
write!(f, "document doesn't have an identifier {}", json)
|
write!(f, "document doesn't have an identifier {}", json)
|
||||||
|
Loading…
Reference in New Issue
Block a user