Improve error msg for no matching rac.CodecReader

This commit is contained in:
Nigel Tao committed 2019-08-08 12:37:07 +10:00
1 parent 05267a2edc
commit a932033d6b
1 file changed
+10 -1
+10 -1
View File
@@ -310,7 +310,16 @@ func (r *Reader) nextChunk() error {
}
}
if codecReader == nil {
r.err = fmt.Errorf("rac: no matching CodecReader for Codec 0x%02X", chunk.Codec)
name := ""
switch chunk.Codec {
case CodecZlib:
name = " (Zlib)"
case CodecBrotli:
name = " (Brotli)"
case CodecZstandard:
name = " (Zstandard)"
}
r.err = fmt.Errorf("rac: no matching CodecReader for Codec 0x%02X%s", chunk.Codec, name)
return r.err
}