blob: 71a5a38f726c1dcf6cad48f3236ba57e24566a7e [file] [log] [blame]
Abhilash S.L3b494632019-07-16 15:51:09 +05301package lz4
2
3import "errors"
4
5var (
6 // ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed
7 // block is corrupted or the destination buffer is not large enough for the uncompressed data.
8 ErrInvalidSourceShortBuffer = errors.New("lz4: invalid source or destination buffer too short")
9 // ErrInvalid is returned when reading an invalid LZ4 archive.
10 ErrInvalid = errors.New("lz4: bad magic number")
11 // ErrBlockDependency is returned when attempting to decompress an archive created with block dependency.
12 ErrBlockDependency = errors.New("lz4: block dependency not supported")
13)
14
15func recoverBlock(e *error) {
16 if recover() != nil && *e == nil {
17 *e = ErrInvalidSourceShortBuffer
18 }
19}