From 4eda438f6f22b113666210e3ce3797c2df61041b Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 15 Jun 2021 14:34:04 +0200 Subject: [PATCH] Add a new Error for when a user use a non-filtered attribute in a filter --- milli/src/error.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/milli/src/error.rs b/milli/src/error.rs index 19f9c364c..a9c2add24 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -56,6 +56,7 @@ pub enum UserError { FilterParsing(pest::error::Error), InvalidCriterionName { name: String }, InvalidDocumentId { document_id: Value }, + InvalidFilterAttribute(pest::error::Error), InvalidStoreFile, MissingDocumentId { document: Object }, MissingPrimaryKey, @@ -204,6 +205,7 @@ impl fmt::Display for UserError { let json = serde_json::to_string(document_id).unwrap(); write!(f, "document identifier is invalid {}", json) }, + Self::InvalidFilterAttribute(error) => error.fmt(f), Self::MissingDocumentId { document } => { let json = serde_json::to_string(document).unwrap(); write!(f, "document doesn't have an identifier {}", json)