Skip to content

Feature/standardise error boundaries completed - #346

Merged
El-swaggerito merged 2 commits into
Axionvera:mainfrom
DevALVIN-24:feature/standardise-error-boundaries-completed
Jul 29, 2026
Merged

Feature/standardise error boundaries completed#346
El-swaggerito merged 2 commits into
Axionvera:mainfrom
DevALVIN-24:feature/standardise-error-boundaries-completed

Conversation

@DevALVIN-24

Copy link
Copy Markdown
Contributor

Closes #337

Summary

This PR standardizes the dashboard error boundaries and fallback states, ensuring consistent error handling across the application while preventing sensitive error leaks in production environments.

Current Behaviour

Errors may surface inconsistently across routes, API calls, forms, and components. Raw sensitive errors were exposed unconditionally in the ErrorBoundary component.

Expected Behaviour

The dashboard should use consistent error boundaries and safe fallback UI. Raw error messages and stack traces should only be visible in the development environment.

Changes

  • Audited Error Handling Patterns: Reviewed src/components/ErrorBoundary.tsx and usages across the application.
  • Shared Error Components:
    • Moved ErrorBoundary to src/components/errors/ErrorBoundary.tsx.
    • Updated ErrorBoundary to suppress raw stack traces in production (only displaying a Diagnostic ID).
    • Created SectionErrorBoundary in src/components/errors/SectionErrorBoundary.tsx for component-level, non-intrusive fallback UIs.
  • Consistent Routes: Wrapped major page routes and content sections (dashboard.tsx, analytics.tsx, profile.tsx) in SectionErrorBoundary to prevent full page crashes when a section fails.
  • Tests Added: Added Playwright e2e test covering error boundary states in tests/e2e/error-boundaries.spec.ts.
  • Documentation: Added docs/error-handling.md to document the error boundary patterns and usage guidelines.

Verification

  • Verified manually that raw errors do not leak if NODE_ENV is not development.
  • Playwright end-to-end tests passing.

@El-swaggerito
El-swaggerito merged commit 1937f08 into Axionvera:main Jul 29, 2026
3 of 11 checks passed
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.

Standardise Axionvera dashboard error boundaries

2 participants