Skip to content

Commit

Permalink
feat: print warning when skipping packets
Browse files Browse the repository at this point in the history
Former-commit-id: a9a562d
  • Loading branch information
dignifiedquire committed Nov 20, 2018
1 parent 41d4c46 commit c8d8680
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/composed/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ pub trait Deserializable: Sized {
/// Parse a list of compositions in raw byte format.
fn from_bytes_many<'a>(bytes: impl Read + 'a) -> Box<dyn Iterator<Item = Result<Self>> + 'a> {
let packets = PacketParser::new(bytes)
.filter(|p| p.is_ok()) // for now we are skipping any packets that we failed to parse
.filter(|p| {
// for now we are skipping any packets that we failed to parse
if !p.is_ok() {
warn!("skipping packet: {:?}", p);
}

p.is_ok()
})
.map(|p| p.expect("filtered"));

Self::from_packets(packets)
Expand Down

0 comments on commit c8d8680

Please sign in to comment.