Skip to content

Commit

Permalink
Don't bail on non-parsing records
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarx committed Dec 12, 2023
1 parent b509d12 commit d84c817
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions helpers/rust/src/types/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,16 @@ impl DumpStatistics {

log::trace!("parsing record: {raw_record:?}");

let mut record: Record =
serde_json::from_str(raw_record).context("Failed parsing the record")?;
let record = serde_json::from_str::<Record>(raw_record);

if let Err(error) = record {
log::warn!("Failed to parse record: {error}");
log::debug!("{raw_record:?}");

return Ok(());
}

let mut record = record?;
record.shrink_to_fit();

match record {
Expand Down

0 comments on commit d84c817

Please sign in to comment.