fix(task) #17 ZipTask and UnzipTask no longer ignore write failures - #21
Merged
Merged
Conversation
… archive cannot be written or extracted, UnzipTask gives the ZipArchive error code on open failure Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 30, 2026
njoubert-cleverage
added a commit
that referenced
this pull request
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #17. Based on #20 (merge #19 and #20 first, this PR will then target
main).ZipTaskandUnzipTaskignored the result ofZipArchive::close()(which writes the archive) andZipArchive::extractTo(): in production (PHP warnings only logged), a write failure passed silently and the task output the path anyway. In debug mode, the task failed with a raw PHP warning.ZipTask: throw a\RuntimeExceptionwhenclose()fails (Unable to write zip file <filename>: <ZipArchive status>)UnzipTask: throw a\RuntimeExceptionwhenextractTo()fails (Unable to extract file <filename> to <destination>: <PHP error>,ZipArchivegives no status for this failure); the open failure message now gives theZipArchiveerror code, asZipTaskdoes@), the exceptions carry their messageZipTaskTest,UnzipTaskTest: missing parent directory, destination being a file, file that is not a zip archive (fail without the fix)zip_task.md,unzip_task.md: document these failuresChecked with
--no-debugin process-bundle-demo:demo.archive.zip_write_failureanddemo.archive.unzip_write_failurenow fail with the exceptions above (they succeeded and output the path before),demo.archive.unzip_not_a_zipfails withUnable to open file .../sample.txt with code 19.Requirements
Breaking changes
A write / extraction failure now fails the task (with the default
stopstrategy, the process fails) instead of being silently ignored in production.🤖 Generated with Claude Code