Skip to content

fix(cli): don't frame clear user-actionable errors as bugs to report#3088

Merged
jorgemoya merged 1 commit into
canaryfrom
jorgemoya/ltrac-1115-user-actionable-cli-errors
Jul 8, 2026
Merged

fix(cli): don't frame clear user-actionable errors as bugs to report#3088
jorgemoya merged 1 commit into
canaryfrom
jorgemoya/ltrac-1115-user-actionable-cli-errors

Conversation

@jorgemoya

@jorgemoya jorgemoya commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Linear: LTRAC-1115

What/Why?

A clear, user-actionable error — a 4xx API response (validation, not-found, not-enabled, conflict) or bad command input — was printed through the top-level fatal handler's bug-report path, appending a Correlation ID and "share this with BigCommerce support" to a message that already told the user what to do. That framing should be reserved for genuine bugs and server-side failures.

Introduces a reusable UserActionableError base class that the top-level handler in index.ts prints plainly (no Correlation ID), then adopts it across the API clients for their clearly-user-actionable cases:

  • domains — 4xx responses, "API not enabled" (403), ownership-verification errors
  • project — validation errors (400/422), "API not enabled", project-not-found (404)
  • logs — "API not enabled", project-not-found, invalid query (400/422), and bad --since/--start/--end input
  • channel — channel-site auth/scope failures
  • auth/login — missing or unvalidatable credentials

UnauthorizedError now extends UserActionableError (same behavior as before, just generalized). 5xx server-side failures and unexpected errors stay plain Errors and keep the Correlation ID + support framing.

Testing

pnpm typecheck, pnpm lint, and the affected specs (domains, observability, index, project, channels, logs, auth, create) — 200 passing. New assertions lock the contract: a 4xx / bad-input error is a UserActionableError; a 5xx stays a plain Error (not UserActionableError).

Migration

None.

@jorgemoya jorgemoya requested a review from a team as a code owner July 8, 2026 16:54
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Jul 8, 2026 8:02pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dd87c45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from aadaf27 (2026-07-08).

No bundle size changes detected.

@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-1115-user-actionable-cli-errors branch from c1f4d54 to 5892381 Compare July 8, 2026 17:23
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-1106-implement-domain-claiming-functionality-in-the-cli branch from 431b401 to 6d780bc Compare July 8, 2026 17:40
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-1115-user-actionable-cli-errors branch 2 times, most recently from e3269c2 to a85abd2 Compare July 8, 2026 17:57
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 92 92 94

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 93 72 90
Accessibility 95 92 95 92
Best Practices 100 100 100 100
SEO 88 100 88 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.6 s 3.2 s 4.1 s 3.6 s
CLS 0.001 0 0.037 0
FCP 1.1 s 1.1 s 1.3 s 1.1 s
TBT 0 ms 0 ms 30 ms 20 ms
Max Potential FID 50 ms 50 ms 70 ms 90 ms
Time to Interactive 3.6 s 3.9 s 4.6 s 4.3 s

Full Unlighthouse report →

Base automatically changed from jorgemoya/ltrac-1106-implement-domain-claiming-functionality-in-the-cli to canary July 8, 2026 19:46
A clear 4xx API response (validation error, not-found, not-enabled, conflict)
or bad command input was printed through the top-level handler's bug-report
path, appending a Correlation ID and "share this with BigCommerce support" to
an already-actionable message.

Add a reusable UserActionableError base class that the top-level handler prints
plainly (UnauthorizedError now extends it). Adopt it across the API clients for
their 4xx / input-validation cases:

- domains: 4xx responses, "API not enabled", ownership-verification errors
- project: validation errors, "not enabled", project-not-found
- logs: "not enabled", project-not-found, invalid query, bad time-window input
- channel: channel-site auth/scope failures
- auth/login: missing or unvalidatable credentials

5xx server-side failures and unexpected errors stay plain Errors and keep the
Correlation ID + support framing.

Refs LTRAC-1115
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-1115-user-actionable-cli-errors branch from a85abd2 to dd87c45 Compare July 8, 2026 20:01
@jorgemoya jorgemoya enabled auto-merge July 8, 2026 20:02
@jorgemoya jorgemoya added this pull request to the merge queue Jul 8, 2026
Merged via the queue into canary with commit ce03afb Jul 8, 2026
24 of 25 checks passed
@jorgemoya jorgemoya deleted the jorgemoya/ltrac-1115-user-actionable-cli-errors branch July 8, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants