Compress/Decompress routines should return Errnos
- Dominant language
- C
- Stars
- 584
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
When an error happens, the API leaves the user wondering why. I suggest that `blosc_compress`, `blosc2_compress_ctx`, `blosc_decompress`, `blosc2_decompress_ctx`, `blosc_getitem`, and `blosc2_getitem_ctx` should all return `-1` on error and set `errno`. Alternatively, Blosc could define its own error codes with negative values.
This would be especially useful for the decompress routines, which can return an error either because the destination buffer is too small, the data is corrupted, or the decompression library is unavailable.
Contributor guide
Research direction
Start with the declarations and implementations of blosc_compress, blosc2_compress_ctx, blosc_decompress, blosc2_decompress_ctx, blosc_getitem, and blosc2_getitem_ctx. First resolve whether errno or library-defined negative codes is the intended contract; done means the chosen behavior consistently covers undersized buffers, corrupted data, and unavailable decompression support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100