From 866ac91be3c38d83535e2b3b58a3b90238fa8960 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 10 Dec 2024 11:06:58 +0100 Subject: [PATCH] Fix error messages --- crates/index-scheduler/src/error.rs | 5 +++-- crates/meilisearch-types/src/error.rs | 2 +- crates/milli/src/error.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/index-scheduler/src/error.rs b/crates/index-scheduler/src/error.rs index 5fb04828c..f6ee1f685 100644 --- a/crates/index-scheduler/src/error.rs +++ b/crates/index-scheduler/src/error.rs @@ -1,12 +1,13 @@ use std::fmt::Display; -use crate::TaskId; use meilisearch_types::batches::BatchId; use meilisearch_types::error::{Code, ErrorCode}; use meilisearch_types::tasks::{Kind, Status}; use meilisearch_types::{heed, milli}; use thiserror::Error; +use crate::TaskId; + #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum DateField { BeforeEnqueuedAt, @@ -103,7 +104,7 @@ pub enum Error { )] InvalidTaskCanceledBy { canceled_by: String }, #[error( - "{index_uid} is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_), and can not be more than 512 bytes." + "{index_uid} is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_), and can not be more than 400 bytes." )] InvalidIndexUid { index_uid: String }, #[error("Task `{0}` not found.")] diff --git a/crates/meilisearch-types/src/error.rs b/crates/meilisearch-types/src/error.rs index afc876b42..0c4027899 100644 --- a/crates/meilisearch-types/src/error.rs +++ b/crates/meilisearch-types/src/error.rs @@ -550,7 +550,7 @@ impl fmt::Display for deserr_codes::InvalidSimilarId { "the value of `id` is invalid. \ A document identifier can be of type integer or string, \ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_), \ - and can not be more than 512 bytes." + and can not be more than 511 bytes." ) } } diff --git a/crates/milli/src/error.rs b/crates/milli/src/error.rs index a6774a7bd..2bd57bba5 100644 --- a/crates/milli/src/error.rs +++ b/crates/milli/src/error.rs @@ -114,7 +114,7 @@ pub enum UserError { "Document identifier `{}` is invalid. \ A document identifier can be of type integer or string, \ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_), \ -and can not be more than 512 bytes.", .document_id.to_string() +and can not be more than 511 bytes.", .document_id.to_string() )] InvalidDocumentId { document_id: Value }, #[error("Invalid facet distribution, {}", format_invalid_filter_distribution(.invalid_facets_name, .valid_facets_name))]