mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Pimp error where no document is provided
This commit is contained in:
parent
ff0908d3fa
commit
59636fa688
3 changed files with 30 additions and 20 deletions
|
@ -174,18 +174,15 @@ impl UpdateLoop {
|
|||
}
|
||||
|
||||
let reader = Cursor::new(buffer);
|
||||
let document_count = match format {
|
||||
match format {
|
||||
DocumentAdditionFormat::Json => read_json(reader, &mut *update_file)?,
|
||||
DocumentAdditionFormat::Csv => read_csv(reader, &mut *update_file)?,
|
||||
DocumentAdditionFormat::Ndjson => read_ndjson(reader, &mut *update_file)?,
|
||||
};
|
||||
|
||||
if document_count > 0 {
|
||||
update_file.persist()?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(UpdateLoopError::MissingPayload(format))
|
||||
}
|
||||
|
||||
update_file.persist()?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.await??;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue