fix(updater): preserve command error details in failed update checks - #6482
Open
SailingLoong wants to merge 1 commit into
Open
fix(updater): preserve command error details in failed update checks#6482SailingLoong wants to merge 1 commit into
SailingLoong wants to merge 1 commit into
Conversation
The updater plugin rejects with plain strings, so err instanceof Error is always false and the real reason (network failure, rate limit, malformed latest.json) is replaced by the generic fallback message. Use the existing extractErrorMessage helper, which already handles strings and Error objects.
This was referenced Aug 15, 2026
Owner
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Hi, and first of all — thank you for maintaining cc-switch. I maintain a small derivative project that keeps syncing with upstream, and I'd like to start giving back some fixes we've found along the way. This is the smallest one, so I figured it's a good icebreaker. 🙂
Summary
err instanceof Error ? err.message : fallbackwith the existingextractErrorMessagehelper inUpdateProvider.instanceof Erroris always false and the real failure reason (network error, rate limit, malformedlatest.json, …) gets replaced by the generic fallback message shown to the user.extractErrorMessagealready exists insrc/utils/errorUtils.tsand is used elsewhere; this is just the one call site that missed it.Validation
npx tsc --noEmitnpx prettier --check src/contexts/UpdateContext.tsxHappy to adjust the approach, wording, or split it differently if you prefer. And if there's a contribution guide or a preferred channel for this kind of small fix, just point me at it.