diff --git a/crates/milli/src/error.rs b/crates/milli/src/error.rs index 3a9c81e10..6c60dcecc 100644 --- a/crates/milli/src/error.rs +++ b/crates/milli/src/error.rs @@ -56,6 +56,8 @@ pub enum InternalError { #[error(transparent)] SerdeJson(#[from] serde_json::Error), #[error(transparent)] + BincodeError(#[from] bincode::Error), + #[error(transparent)] Serialization(#[from] SerializationError), #[error(transparent)] Store(#[from] MdbError), diff --git a/crates/milli/src/update/new/merger.rs b/crates/milli/src/update/new/merger.rs index 9d0d8e176..f6876b3d9 100644 --- a/crates/milli/src/update/new/merger.rs +++ b/crates/milli/src/update/new/merger.rs @@ -48,8 +48,7 @@ where } let mut file = tempfile::tempfile()?; - /// manage error - bincode::serialize_into(&mut file, &rtree).unwrap(); + bincode::serialize_into(&mut file, &rtree).map_err(InternalError::BincodeError)?; file.sync_all()?; let rtree_mmap = unsafe { Mmap::map(&file)? };