fix(cli): throw CliUserError from bundle zip expected failures - #2954
Open
posthog-eu[bot] wants to merge 1 commit into
Open
fix(cli): throw CliUserError from bundle zip expected failures#2954posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
The five expected user-configuration aborts in `cli/src/bundle/zip.ts` threw bare `Error`, so `shouldCapturePosthogException` still opened an error tracking `$exception` issue for each. Swap them to `CliUserError`, the same marker `bundle upload` already uses through `uploadFail`, so the telemetry skips these deliberate stops. Messages, exit codes, and the existing analytics events stay unchanged. Generated-By: PostHog Code Task-Id: 07a4bba7-a89a-4f63-a64b-e1253273dd2d
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
|
riderx
marked this pull request as ready for review
August 8, 2026 22:18
5 tasks
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
bundle zip's five expected user-configuration aborts still open error tracking$exceptionissues, sharded across many fingerprints, which keep resurfacing as brand-new issues.cli/src/bundle/zip.tsthrew bareErrorin five places, soshouldCapturePosthogExceptionnever skipped them — unlikebundle upload, which routes every abort throughuploadFailand throwsCliUserError.throw new Error(...)calls forCliUserError(fromcli/src/shared/cli-user-error.ts).shouldCapturePosthogExceptionalready skips that type.The user experience was already correct — each site prints a clear message and a machine-readable
emitJsonErrorcode before it throws. Only the telemetry was wrong.zip.ts)Invalid bundle version formatinvalid_semverappId/bundle/pathmissing_argumentnotifyAppReady() is missing in build foldernotifyAppReady_not_in_source_codeindex.html is missing in root folderindex_html_not_foundCannot find @capgo/capacitor-updater in node_modulesNotes:
zipFailhelper was added. Each site already gates its logging inline onsilent/json, so a helper would not co-locate log + throw the wayuploadFaildoes — it would only add indirection.error instanceof Error ? error : new Error(String(error))) passesCliUserErrorstraight through, since it extendsError. Exit codes and analytics events are unchanged; only the$exceptioncapture goes away.Test plan
bundle zipon a build folder missingnotifyAppReady()still prints the same error and exits non-zero, but no error tracking$exceptionissue is opened.notifyAppReady, missingindex.html, missing updater plugin) behaves as before, in both default and--jsonoutput.Screenshots
Checklist
bun run lint:backend && bun run lint.accordingly.
my tests
Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.