Skip to content

Commit 5284cb9

Browse files
committed
fix(update): keep Error cause on binary upgrade failure
1 parent 4712180 commit 5284cb9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎packages/commands/src/commands/update.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ export default defineCommand({
154154
writeUpdateState(newVer);
155155
updateAgentSkill(color);
156156
} catch (error) {
157-
const message = error instanceof Error ? error.message : String(error);
158157
const reinstall =
159158
error instanceof BailianError && error.hint
160159
? error.hint.replace(/^Re-run:\s*/i, "")
@@ -163,7 +162,7 @@ export default defineCommand({
163162
"Automatic binary update failed.",
164163
ExitCode.GENERAL,
165164
`Re-run the install script:\n ${reinstall}`,
166-
{ cause: message },
165+
{ cause: error },
167166
);
168167
}
169168
return;

0 commit comments

Comments
 (0)