Fix the error variants

This commit is contained in:
Kerollmops 2025-03-10 15:41:32 +01:00
parent 34df44a002
commit 78ebd8dba2
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
2 changed files with 10 additions and 9 deletions

View file

@ -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);