Skip to content

Commit e1984f1

Browse files
betegonclaude
andcommitted
fix: re-throw WizardError without double-displaying
When a WizardError thrown inside the wizard loop was caught by the outer catch block, it would call log.error + cancel again before re-wrapping. Now WizardError instances are re-thrown immediately to avoid duplicate output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6fe3daf commit e1984f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/init/wizard-runner.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ async function resolvePreSpinnerOptions(
564564
return opts;
565565
}
566566

567+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: sequential wizard orchestration with error handling branches
567568
export async function runWizard(initialOptions: WizardOptions): Promise<void> {
568569
const { directory, yes, dryRun, features } = initialOptions;
569570

@@ -692,6 +693,10 @@ export async function runWizard(initialOptions: WizardOptions): Promise<void> {
692693
process.exitCode = 0;
693694
return;
694695
}
696+
// Already rendered by an inner throw — don't double-display
697+
if (err instanceof WizardError) {
698+
throw err;
699+
}
695700
if (spinState.running) {
696701
spin.stop("Error", 1);
697702
spinState.running = false;

0 commit comments

Comments
 (0)