From b138b92d393e6d41928253290789bf1d464f9e27 Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Fri, 4 Mar 2022 15:31:11 +0800 Subject: [PATCH] show detailed error message --- meilisearch-lib/src/document_formats.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meilisearch-lib/src/document_formats.rs b/meilisearch-lib/src/document_formats.rs index 6b018e683..b458a124e 100644 --- a/meilisearch-lib/src/document_formats.rs +++ b/meilisearch-lib/src/document_formats.rs @@ -34,12 +34,12 @@ impl Display for DocumentFormatError { match self { Self::Internal(e) => write!(f, "An internal error has occurred. `{}`.", e), Self::MalformedPayload(me, b) => match me.borrow() { - milli::documents::Error::JsonError(_) => write!( + milli::documents::Error::JsonError(se) => write!( f, - "The `{}` payload provided is malformed. line: {}", - b, "TODO" + "The `{}` payload provided is malformed. `Couldn't serialize document value. at line {} column {}`", + b,se.line(),se.column() ), - _ => write!(f, "The `{}` payload provided is malformed. line: {}", b, me), + _ => write!(f, "The `{}` payload provided is malformed. `{}`.", b, me), }, } }