Skip to content

Commit c3f279d

Browse files
committed
fix(cli): report the response status in the capture command's JSON output
The status reached `CaptureResult` and was then dropped at the CLI boundary, which is the same read-once-and-discard that made the error page harvestable in the first place. `--json` is the documented programmatic surface, and an agent reading `ok: true` off a capture of a 404 has no way to see it there.
1 parent 573764c commit c3f279d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/cli/src/commands/capture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ export default defineCommand({
204204
ok: result.ok,
205205
projectDir: result.projectDir,
206206
url: result.url,
207+
// Reported beside `ok`, because they answer different questions: a capture of an
208+
// error page is `ok: true` with a status the caller has to see to know it.
209+
httpStatus: result.httpStatus,
207210
title: result.title,
208211
screenshots: result.screenshots.length,
209212
assets: result.assets.length,

0 commit comments

Comments
 (0)