ribzip2 icon indicating copy to clipboard operation
ribzip2 copied to clipboard

Improve error handling in libribzip2

Open torfmaster opened this issue 4 years ago • 0 comments

Provide error types for compression and decompression. There should be

  • a type for compression basically wrapping IO errors
  • a type for decompression basically wrapping IO errors or a decompression domain specific error

As decompression errors are usually not recoverable the decompression domain specific error could be a flat enum containing the following cases (to be completed)

  • selected non-existing Huffman table
  • data exceeds block size of 900k (e.g. RLE or ZLE produces unexpectedly long blocks)
  • crc errors
  • orig_pointer out of bounds

and many more. The errors should come with speaking display implementations. Ideally the CLI should display them instead of just panicking.

torfmaster avatar Jan 29 '22 16:01 torfmaster