Currently, the errors returned in archive/zip are often not very clear due to the following issues:
- They lack documentation (e.g. ErrAlgorithm in reader.go on lines 25 and 190).
- They are too generic to provide an actionable error message to the end user (e.g. ErrFormat in reader.go on lines 24 and 238).
- They are not stored in a variable (e.g. the error in writer.go on line 512).
- One return in particular seems to violate the documentation of io.Reader: on line 245 of reader.go we return 0, io.ErrUnexpectedEOF. But the documentation of io.Reader states "When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes, it returns the number of bytes read." So we should return n instead of 0.
I would like to replace the current errors in archive/zip with actionable, clearly documented variables, like the ones we see in io/io.go. If you accept the general outline of the proposal, I can make a detailed design doc containing every error I would like to create. A design doc seems important given the number of public-facing changes that are needed.
Currently, the errors returned in archive/zip are often not very clear due to the following issues:
I would like to replace the current errors in archive/zip with actionable, clearly documented variables, like the ones we see in io/io.go. If you accept the general outline of the proposal, I can make a detailed design doc containing every error I would like to create. A design doc seems important given the number of public-facing changes that are needed.