Skip to content

refactor(cli): consolidate error message handling - #1758

Merged
John-David Dalton (jdalton) merged 1 commit into
fix/bazel-maven-backup-sourcesfrom
fix/shared-error-message
Nov 25, 2026
Merged

John-David Dalton (jdalton) merged 1 commit into
fix/bazel-maven-backup-sourcesfrom
fix/shared-error-message

Conversation

@jdalton

Copy link
Copy Markdown
Contributor

Use one shared errorMessage() helper for CLI errors and download failures. It returns Unknown error when no message is available.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Mechanical rename and import consolidation with equivalent fallback behavior; no changes to auth, API contracts, or business logic beyond minor Coana build error wording.

Overview
Renames getErrorCause to errorMessage in src/utils/errors.mts and updates imports and call sites across commands (fix, logout, Bazel manifest paths, wrappers), API/SDK/config utilities, and SEA build code. Behavior is unchanged: errorMessage still returns the thrown value’s message or falls back to UNKNOWN_ERROR for CResult causes and user-facing logs.

download-bytes.mts drops its local errorMessage helper and imports the shared one so download retry failures use the same formatting. formatErrorWithDetail renames an inner variable to detail so it no longer shadows the exported function.

SEA Coana staging tweaks error copy slightly: API deny errors use result.message / result.cause directly, and fetch failures are wrapped with errorMessage(error) in a shorter build-time message. Tests and mocks that stubbed getErrorCause now stub errorMessage.

Reviewed by Cursor Bugbot for commit 4644167. Configure here.

@jdalton
John-David Dalton (jdalton) force-pushed the fix/native-coana-runtime-download branch from 44919b1 to dcb294c Compare November 25, 2026 02:07
@jdalton
John-David Dalton (jdalton) force-pushed the fix/native-coana-runtime-download branch from dcb294c to 4331b44 Compare November 25, 2026 02:12
@jdalton
John-David Dalton (jdalton) force-pushed the fix/shared-error-message branch 2 times, most recently from 1ec5660 to 23711a3 Compare November 25, 2026 02:14
@jdalton
John-David Dalton (jdalton) force-pushed the fix/native-coana-runtime-download branch from 4331b44 to 1080dd1 Compare November 25, 2026 02:14
@jdalton
John-David Dalton (jdalton) changed the base branch from fix/native-coana-runtime-download to v1.x November 25, 2026 02:15
@jdalton
John-David Dalton (jdalton) changed the base branch from v1.x to fix/bazel-maven-backup-sources November 25, 2026 03:10
@jdalton
John-David Dalton (jdalton) merged commit 55b7275 into fix/bazel-maven-backup-sources Nov 25, 2026
24 checks passed
@jdalton
John-David Dalton (jdalton) deleted the fix/shared-error-message branch November 25, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant