Skip to content

Commit

Permalink
add error context
Browse files Browse the repository at this point in the history
  • Loading branch information
ZENOTME committed Dec 19, 2023
1 parent e4438c1 commit 2f640bf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/iceberg/src/spec/manifest_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Result<Vec<_>, _>>()?,
})
Expand Down Expand Up @@ -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::<Result<Vec<_>, _>>()?,
})
Expand Down

0 comments on commit 2f640bf

Please sign in to comment.