fix: replace panics with exitError and add timeout to external --exec command#52
Open
jonbaldie wants to merge 1 commit into
Open
fix: replace panics with exitError and add timeout to external --exec command#52jonbaldie wants to merge 1 commit into
jonbaldie wants to merge 1 commit into
Conversation
…ommand Replaces five panic calls for OS-level errors (MkdirTemp, MkdirAll, CopyFile, and exec.Run) with clean exitError returns. Moves tmpDir cleanup into a defer so it runs even when an error returns early from the file loop. Fixes the external --exec path: uses CommandContext so the process is killed after --exec-timeout seconds (treating deadline-exceeded as exit code 2/skip), falls back to 10s when timeout is zero, and removes the Start/Wait pair along with its TODO comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 14, 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.
OS-level errors in the main loop (MkdirTemp, MkdirAll, CopyFile) panicked with a raw stack trace instead of a readable message, and the
--do-not-remove-tmp-folderflag meant the cleanup only happened in one place so an early return leaked the temp dir; this PR replaces all those panics withexitErrorreturns, moves cleanup into adefer, and fixes the external--execpath to useexec.CommandContextso it is killed after--exec-timeoutseconds (returning exit code 2/skip on deadline exceeded) rather than hanging forever.