From a21c8547904af27bcf9dd0d057f8981842a56a50 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Thu, 26 Aug 2021 11:43:17 +0200 Subject: [PATCH] handle errors --- milli/src/update/index_documents/extract/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/milli/src/update/index_documents/extract/mod.rs b/milli/src/update/index_documents/extract/mod.rs index 736060b15..aefc0ff92 100644 --- a/milli/src/update/index_documents/extract/mod.rs +++ b/milli/src/update/index_documents/extract/mod.rs @@ -182,10 +182,13 @@ fn extract_documents_data( let _ = lmdb_writer_sx.send(Ok(TypedChunk::Documents(documents_chunk.clone()))); - let (documents_chunk_cloned, lmdb_writer_sx_cloned) = (documents_chunk.clone(), lmdb_writer_sx.clone()); + let documents_chunk_cloned = documents_chunk.clone(); + let lmdb_writer_sx_cloned = lmdb_writer_sx.clone(); rayon::spawn(move || { - let geo_points = extract_geo_points(documents_chunk_cloned, indexer, geo_field_id).unwrap(); - lmdb_writer_sx_cloned.send(Ok(TypedChunk::GeoPoints(geo_points))).unwrap(); + let _ = match extract_geo_points(documents_chunk_cloned, indexer, geo_field_id) { + Ok(geo_points) => lmdb_writer_sx_cloned.send(Ok(TypedChunk::GeoPoints(geo_points))), + Err(error) => lmdb_writer_sx_cloned.send(Err(error)), + }; }); let (docid_word_positions_chunk, docid_fid_facet_values_chunks): (Result<_>, Result<_>) =