Skip to content

fix: surface errors to UI instead of console.error - #141

Merged
NoviUIKI merged 1 commit into
feat/i18n-completionfrom
feat/error-surfacing
Aug 19, 2026
Merged

NoviUIKI merged 1 commit into
feat/i18n-completionfrom
feat/error-surfacing

Conversation

@BerryUIKI

@BerryUIKI BerryUIKI commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replace silent console.error calls with UI-visible error handling (task #3).

Changes

  • useOptions: mutations now expose their error via mutation.error; OptionContractTable renders a delete-failure banner
  • useGooseAnalysis: run errors propagate via mutation.error; workspace-validation error surfaced to ShadowAnalysis
  • ShadowAnalysis: renders an error state with retry instead of logging silently

Base is feat/i18n-completion (stacked PR); merge after #140.

- useOptions: expose mutation error for delete/update so the table can
  render a visible failure banner
- useGooseAnalysis: propagate run errors via mutation.error
- ShadowAnalysis: show error state with retry instead of silent logging

@NoviUIKI NoviUIKI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — PR #141

Verdict: ✅ Approve

Solid error-handling cleanup. I verified every mutation whose console.error was removed, and all in-use ones have their errors surfaced in the UI (typecheck passes).

Critical

  • None.

Important

  • None.

Suggestions (non-blocking)

  1. Four hooks are now dead code in useOptions.ts: useDeleteOptionChain, useCalculateOptionPrice, useCalculateIV, and useUpdateOptionStrategy have no consumers. Removing their console.error is harmless, but consider deleting or wiring them up in a follow-up so dead code doesn't linger.
  2. No test for the new validationError path. A small test on useGooseShadowAnalysis (or the component) covering "no workspace → validation error state" would lock in the behavior this PR introduces.
  3. Minor: validationError is a plain boolean. If more validation branches appear later, a string reason would give more informative UI.

Strengths

  • Replaces hook-level console.error with per-invocation/state-based error surfacing — the idiomatic React Query pattern. Errors no longer vanish into the console.
  • Verified surfacing per mutation: useFetchOptionChain → call-site onError → ErrorState in OptionsPage; useCalculateGreeks → banner in GreeksCalculator; useCreateOptionStrategy/useDeleteOptionStrategy → ErrorState in OptionStrategyPanel; useDeleteOptionContract → banner in OptionContractTable; useStartShadowAnalysis → ErrorState in ShadowAnalysis.
  • ShadowAnalysis now shows a proper "select a workspace" error state instead of a silent console.error, and the error auto-clears once a workspace is selected (the useEffect on workspaceId).

Verification

  • tsc --noEmit (apps/desktop): passes.

@NoviUIKI
NoviUIKI merged commit 04327b3 into dev Aug 19, 2026
@BerryUIKI
BerryUIKI deleted the feat/error-surfacing branch August 20, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants