Skip to content

Commit b0839fc

Browse files
cs-rajclaude
andcommitted
fix(bootstrap): surface precise branch-not-found error to the developer
Replace the generic cliux.error+rethrow pattern with a single clean Error throw so oclif prints one message. Message names both the repo and the missing cli-use branch so the developer knows exactly what to check on GitHub. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0d34d71 commit b0839fc

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fileignoreconfig:
44
- filename: packages/contentstack-audit/test/unit/mock/am-contents/environments/environments.json
55
checksum: ffaaee9269a6e833cd3dbe337ddc5c060cce948519873c7a2777754519a31b52
66
- filename: pnpm-lock.yaml
7-
checksum: 649aae748e3ae8c157439dc6c7c9ea402cc19b4dab7ca64b7e4d839d1375df53
7+
checksum: fda8964d238e0d30577ce8f5bf879a2102c69a7f9e83067ab1627b9b1db9d066
88
- filename: packages/contentstack-audit/src/types/content-types.ts
99
checksum: d16a65415c3184f15a807d58e5858310aeb5633794fc9075e36f89c94da636c3
1010
- filename: packages/contentstack-audit/src/audit-base-command.ts

packages/contentstack-bootstrap/messages/index.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"CLI_BOOTSTRAP_GITHUB_ACCESS_NOT_FOUND": "No Github access token found",
55
"CLI_BOOTSTRAP_START_CLONE_APP": "Cloning the selected app",
66
"CLI_BOOTSTRAP_REPO_NOT_FOUND": "Unable to find a repo for \"%s\"",
7+
"CLI_BOOTSTRAP_APP_UNAVAILABLE": "Unable to download \"%s\": branch \"cli-use\" not found. Ensure the branch exists on the GitHub repository.",
78
"CLI_BOOTSTRAP_NO_API_KEY_FOUND": "No API key generated for the stack",
89
"CLI_BOOTSTRAP_STACK_CREATION_FAILED": "Unable to create stack for content \"%s\"",
910
"CLI_BOOTSTRAP_APP_SELECTION_ENQUIRY": "Select an App",

packages/contentstack-bootstrap/src/bootstrap/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ export default class Bootstrap {
7474
cliux.loader();
7575
} catch (error) {
7676
cliux.loader();
77-
if (error instanceof GithubError) {
78-
if (error.status === 404) {
79-
cliux.error(messageHandler.parse('CLI_BOOTSTRAP_REPO_NOT_FOUND', this.appConfig.source));
80-
}
77+
if (error instanceof GithubError && error.status === 404) {
78+
throw new Error(messageHandler.parse('CLI_BOOTSTRAP_APP_UNAVAILABLE', this.appConfig.source));
8179
}
8280
throw error;
8381
}

0 commit comments

Comments
 (0)