Repository navigation
fix(cli): report command failures in text and JSON modes - #522
Merged
Merged
Conversation
Pavel Feldman (pavelfeldman)
marked this pull request as ready for review
November 5, 2026 22:39
Pavel Feldman (pavelfeldman)
approved these changes
Nov 5, 2026
The entry point discarded the promise from program(), so argument
parsing, startup and daemon validation failures surfaced as unhandled
rejections with a stack trace, and `--json` produced no output. Report
them as a message on stderr, or `{ isError: true, error }` on stdout in
JSON mode, with exit code 1. The output mode comes from the parsed
arguments, or from the `--json` flag when parsing itself fails.
Fixes: #502
Pavel Feldman (pavelfeldman)
force-pushed
the
triage/502/42092304640-1
branch
from
November 5, 2026 22:57
17cceb1 to
66053c0
Compare
bizya (b1zya)
added a commit
to b1zya/patchright-cli
that referenced
this pull request
Nov 8, 2026
Resolves the blocked merge of tests/integration.spec.ts (b85c7a7 -> 4bc00fb). Upstream's update-check tests use an npm registry fixture; our update check reads GitHub releases, so our cases stay. From microsoft#502 the plain-mode --headed=false argument error is taken; the --json wrapping (microsoft#522) is client code that arrives with a later patchright-core roll. Closes #16 Closes #18
bizya (b1zya)
added a commit
to b1zya/patchright-cli
that referenced
this pull request
Nov 8, 2026
Resolves the blocked merge of tests/integration.spec.ts (b85c7a7 -> 4bc00fb). Upstream's update-check tests use an npm registry fixture; our update check reads GitHub releases, so our cases stay. From microsoft#502 the plain-mode --headed=false argument error is taken; the --json wrapping (microsoft#522) is client code that arrives with a later patchright-core roll. Closes #16 Closes #18
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.
Summary
program(), so argument parsing, startup and daemon validation failures surfaced as unhandled rejections with a stack trace, and--jsonproduced no output.{ "isError": true, "error": "..." }on stdout in JSON mode, with exit code 1. The output mode comes from the arguments parsed with the core'sparseArgs()(chore: roll Playwright to 1.66.0-alpha-1793916328000 #523), read beforeprogram()runs; when parsing itself fails, it falls back to the--jsonflag.Fixes #502