Abhilash S.L | 3b49463 | 2019-07-16 15:51:09 +0530 | [diff] [blame] | 1 | package lz4 |
| 2 | |
| 3 | import "errors" |
| 4 | |
| 5 | var ( |
| 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 | |
| 15 | func recoverBlock(e *error) { |
| 16 | if recover() != nil && *e == nil { |
| 17 | *e = ErrInvalidSourceShortBuffer |
| 18 | } |
| 19 | } |