mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Fix the error variants
This commit is contained in:
parent
34df44a002
commit
78ebd8dba2
2 changed files with 10 additions and 9 deletions
|
@ -80,9 +80,13 @@ impl DocumentsBatchIndex {
|
|||
let mut map = Object::new();
|
||||
|
||||
for (k, v) in document.iter() {
|
||||
// TODO: TAMO: update the error type
|
||||
let key =
|
||||
self.0.get_by_left(&k).ok_or(crate::error::InternalError::DatabaseClosing)?.clone();
|
||||
let key = self
|
||||
.0
|
||||
.get_by_left(&k)
|
||||
.ok_or(crate::error::InternalError::FieldIdMapMissingEntry(
|
||||
FieldIdMapMissingEntry::FieldId { field_id: k, process: "recreate_json" },
|
||||
))?
|
||||
.clone();
|
||||
let value = serde_json::from_slice::<serde_json::Value>(v)
|
||||
.map_err(crate::error::InternalError::SerdeJson)?;
|
||||
map.insert(key, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue