Skip to content

Conversation

@antongolub
Copy link
Collaborator

@antongolub antongolub commented Jul 28, 2025

const o = await $({ nothrow: true })`\033`
assert.equal(o.ok, false)
assert.match(o.cause.message, /malformed/i)
  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub added the bug label Jul 28, 2025
@antongolub antongolub requested a review from Copilot July 28, 2025 12:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes error handling in the ProcessPromise initialization stage by properly supporting the nothrow option when errors occur during command building and validation.

  • Refactors ProcessPromise initialization to defer command building and validation until construction
  • Adds proper error handling with nothrow support during the init stage
  • Removes global state management in favor of direct snapshot attachment

Reviewed Changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/core.ts Major refactor of ProcessPromise initialization, error handling, and command building logic
src/util.ts Adds utility function to convert iterators to arrays
test/core.test.js Adds test case for nothrow behavior with malformed commands
src/vendor-core.ts Removes unused TSpawnResult type export
test-d/core.test-d.ts Updates ProcessOutput constructor test expectation
package.json Updates @types/node dependency version
build/ files Generated build artifacts reflecting source changes
.size-limit.json Updates size limits to accommodate code changes
Comments suppressed due to low confidence (1)

src/core.ts:386

  • The parameter name 'legacy' is unclear in this context. Consider renaming to something more descriptive like 'fromInitStage' or 'throwOnError' to better convey its purpose.
      if (legacy) {

@antongolub antongolub merged commit 95b844d into google:main Jul 28, 2025
28 checks passed
@antongolub antongolub deleted the fix-nothrow-init branch July 28, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant