mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-12 14:26:29 +01:00
Fix the error messages categorization with invalid NDJson
This commit is contained in:
parent
d683f5980c
commit
69c931334f
@ -624,13 +624,12 @@ async fn document_addition(
|
||||
None => None,
|
||||
};
|
||||
|
||||
let documents_count = file
|
||||
.as_ref()
|
||||
.map_or(Ok(0), |ntf| read_ndjson(ntf.as_file()))
|
||||
.map_err(|e| MeilisearchHttpError::Payload(ReceivePayload(Box::new(e))));
|
||||
let documents_count = file.as_ref().map_or(Ok(0), |ntf| {
|
||||
read_ndjson(ntf.as_file()).map_err(MeilisearchHttpError::DocumentFormat)
|
||||
})?;
|
||||
let update_file = file_store::File::from_parts(path, file);
|
||||
update_file.persist()?;
|
||||
Ok(documents_count)
|
||||
Ok(Ok(documents_count))
|
||||
}
|
||||
PayloadType::Json | PayloadType::Csv { delimiter: _ } => {
|
||||
let temp_file = match tempfile() {
|
||||
|
Loading…
Reference in New Issue
Block a user