mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Pimp error where no document is provided
This commit is contained in:
@ -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??;
|
||||
|
||||
|
Reference in New Issue
Block a user