From 60792eebcf33785126f10e9e054638405b3a0e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Wi=C5=9Bniewski?= Date: Wed, 31 Aug 2022 19:29:53 +0200 Subject: [PATCH] Fix #2207 - do not panic when the error message length is between 100 and 135 --- meilisearch-lib/src/document_formats.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch-lib/src/document_formats.rs b/meilisearch-lib/src/document_formats.rs index ebc98f3fb..be48c9bbf 100644 --- a/meilisearch-lib/src/document_formats.rs +++ b/meilisearch-lib/src/document_formats.rs @@ -44,7 +44,7 @@ impl Display for DocumentFormatError { // The user input maybe insanely long. We need to truncate it. let mut serde_msg = se.to_string(); let ellipsis = "..."; - if serde_msg.len() > 100 + ellipsis.len() { + if serde_msg.len() > (50 + 85) + ellipsis.len() { serde_msg.replace_range(50..serde_msg.len() - 85, ellipsis); }