Skip to content

Commit a5adbe2

Browse files
authored
Merge pull request #416 from akiver/warn-corrupt
feat: warn and continue parsing on msg decompression failure
2 parents 161565a + 4f85fec commit a5adbe2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/demoinfocs/parsing.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,13 @@ func (p *parser) parseFrameS2() bool {
346346

347347
buf, err = snappy.Decode(nil, buf)
348348
if err != nil {
349-
panic(err) // FIXME: avoid panic
349+
if errors.Is(err, snappy.ErrCorrupt) {
350+
p.eventDispatcher.Dispatch(events.ParserWarn{
351+
Message: "compressed message is corrupt",
352+
})
353+
} else {
354+
panic(err)
355+
}
350356
}
351357
}
352358

0 commit comments

Comments
 (0)