Commit 362b813
fix(init): match formatError priority order for WizardError message (#981)
## Summary
The squash merge for #980 captured the first 3 commits but missed the
priority-order fix that came in as a follow-up from a bot review. Main
currently has `result.result?.message ?? result.error` but `formatError`
(which writes to the terminal) uses the opposite: `result.error ??
inner?.message`. This makes the terminal output and the Sentry exception
message inconsistent when both fields are set.
## Changes
One-line fix in `handleFinalResult` (`wizard-runner.ts`): swap the
operands so the Sentry message uses `result.error ??
result.result?.message`, matching `formatError` exactly.
In practice the two fields are mutually exclusive (structured bails
populate `result.result.message`; Mastra framework failures populate
`result.error`), so there's no user-visible behaviour change — just
consistency between what the terminal shows and what Sentry captures.
## Test Plan
Existing tests in `wizard-runner-handle-final-result.mocked.test.ts`
cover both the `result.error` and `result.result.message` paths and pass
unchanged.
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent df7b32d commit 362b813
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
872 | | - | |
| 872 | + | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| |||
0 commit comments