Skip to content

Added ZipFileError - #362

Open
catamphetamine wants to merge 2 commits into
ZJONSSON:masterfrom
catamphetamine:feature/specific-error
Open

Added ZipFileError#362
catamphetamine wants to merge 2 commits into
ZJONSSON:masterfrom
catamphetamine:feature/specific-error

Conversation

@catamphetamine

@catamphetamine catamphetamine commented Jul 27, 2026

Copy link
Copy Markdown

Currently, if an invalid .zip file is passed, unzipper could output all sorts of errors:

  • invalid zip64 end of central dir locator signature (0x07064b50) from Open/directory.js
  • code: "Z_DATA_ERROR" from zlib module
  • FILE_ENDED from PullStream.js
  • invalid signature: 0x from parse.js

This PR unifies those errors under a single one called ZipFileError, which is exported from the package and could be used to detect when unzipping couldn't be performed specifically because of the input file being invalid.


This is something I use in my own fork to signal "invalid input data" type of errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant