From 2f640bf521e466efb5e84c1a56812686aeb4f7ae Mon Sep 17 00:00:00 2001 From: ZENOTME Date: Tue, 19 Dec 2023 13:04:03 +0800 Subject: [PATCH] add error context --- crates/iceberg/src/spec/manifest_list.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/iceberg/src/spec/manifest_list.rs b/crates/iceberg/src/spec/manifest_list.rs index a0d3b4eeb..76b8b53dd 100644 --- a/crates/iceberg/src/spec/manifest_list.rs +++ b/crates/iceberg/src/spec/manifest_list.rs @@ -694,7 +694,15 @@ pub(super) mod _serde { .into_iter() .map(|v| { let partition_spec_id = v.partition_spec_id; + let manifest_path = v.manifest_path.clone(); v.try_into(partition_types.get(&partition_spec_id)) + .map_err(|err| { + err.with_context("manifest file path", manifest_path) + .with_context( + "partition spec id", + partition_spec_id.to_string(), + ) + }) }) .collect::, _>>()?, }) @@ -728,7 +736,15 @@ pub(super) mod _serde { .into_iter() .map(|v| { let partition_spec_id = v.partition_spec_id; + let manifest_path = v.manifest_path.clone(); v.try_into(partition_types.get(&partition_spec_id)) + .map_err(|err| { + err.with_context("manifest file path", manifest_path) + .with_context( + "partition spec id", + partition_spec_id.to_string(), + ) + }) }) .collect::, _>>()?, })