mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-30 23:13:09 +08:00
Fix #2207 - do not panic when the error message length is between 100 and 135
This commit is contained in:
parent
3efd06168f
commit
60792eebcf
@ -44,7 +44,7 @@ impl Display for DocumentFormatError {
|
|||||||
// The user input maybe insanely long. We need to truncate it.
|
// The user input maybe insanely long. We need to truncate it.
|
||||||
let mut serde_msg = se.to_string();
|
let mut serde_msg = se.to_string();
|
||||||
let ellipsis = "...";
|
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);
|
serde_msg.replace_range(50..serde_msg.len() - 85, ellipsis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user