Skip to content

Commit f895bf7

Browse files
committed
feat: warn and continue parsing on msg decompression failure
ref #409
1 parent 161565a commit f895bf7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/demoinfocs/parsing.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,15 @@ func (p *parser) parseFrameS2() bool {
345345
var err error
346346

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

0 commit comments

Comments
 (0)