Skip to content

bug: empty / silent catch blocks hide errors across the codebase #425

Description

@nanaf6203-bit

Summary

Several catch blocks silently swallow errors, returning defaults or doing nothing.

Affected area

(every try { … } catch { } or near-empty catch observed in repo)

  • src/utils/security/blockchainSecurity.ts — falls back to default score, hides errors
  • src/utils/security/phishingProtection.ts — silently returns unsafe=false
  • src/utils/walletHelpers.ts — returns null
  • src/hooks/useSearchHistory.ts — JSON.parse failures disappear
  • src/hooks/useCurrencyConverter.ts — silently fails rate fetch
  • src/components/ViewToggle.tsx — swallows localStorage errors

Steps to reproduce / impact

Silent catch blocks hide regressions, data corruption, and intermittent outages from observability tools. Users experience mysterious failures.

Expected behaviour

At minimum, log via logger.warn/logger.error and add structured context. Trigger user-visible toasts when the failure affects UX.

Acceptance criteria

  • Sweep empty catch blocks; require at least a structured log.
  • Add ESLint rule or codemod nudging engineers.
  • Verify Sentry / error reporting picks the error up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working correctlypriority/p2P2 — medium priorityrefactorCode health / refactor (no behaviour change)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions