From de962a26f3d9dbf5868b376a8e9fb8c2d1f609ee Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 27 Aug 2024 17:47:02 +0200 Subject: [PATCH] New error type when maxBytes is null --- meilisearch-types/src/error.rs | 1 + milli/src/error.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/meilisearch-types/src/error.rs b/meilisearch-types/src/error.rs index 4d80fe9c9..0099cada5 100644 --- a/meilisearch-types/src/error.rs +++ b/meilisearch-types/src/error.rs @@ -388,6 +388,7 @@ impl ErrorCode for milli::Error { | UserError::InvalidOpenAiModelDimensionsMax { .. } | UserError::InvalidSettingsDimensions { .. } | UserError::InvalidUrl { .. } + | UserError::InvalidSettingsDocumentTemplateMaxBytes { .. } | UserError::InvalidPrompt(_) => Code::InvalidSettingsEmbedders, UserError::TooManyEmbedders(_) => Code::InvalidSettingsEmbedders, UserError::InvalidPromptForEmbeddings(..) => Code::InvalidSettingsEmbedders, diff --git a/milli/src/error.rs b/milli/src/error.rs index 47a497292..f0e92a9ab 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -258,6 +258,8 @@ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and undersco }, #[error("`.embedders.{embedder_name}.dimensions`: `dimensions` cannot be zero")] InvalidSettingsDimensions { embedder_name: String }, + #[error("`.embedders.{embedder_name}.documentTemplateMaxBytes`: `documentTemplateMaxBytes` cannot be zero")] + InvalidSettingsDocumentTemplateMaxBytes { embedder_name: String }, #[error("`.embedders.{embedder_name}.url`: could not parse `{url}`: {inner_error}")] InvalidUrl { embedder_name: String, inner_error: url::ParseError, url: String }, #[error("Document editions cannot modify a document's primary key")]