Add comprehensive error handling and recovery UI #173
Reference in New Issue
Block a user
Delete Branch "claude/electron-error-handling-tPCJO"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements a complete error handling system with user-friendly recovery UI, including error boundaries at multiple levels, centralized error classification, and improved IPC error logging.
Key Changes
Error Boundaries: Added two-tier error boundary system:
TopLevelErrorBoundarycatches crashes outside the router (bootstrap failures)RouteErrorBoundarycatches route-level crashes with automatic reset on navigationError Classification & User Messages: Created
@/lib/errors.tswith:ApiErrorclass for HTTP failures with status-aware messagingQuotaExceededErrorfor free-plan message limit exhaustiontoUserMessage()function that maps any error to user-friendly textlogError()andreportError()functions for different severity levelsError Fallback UI: Implemented
error-fallback.tsxwith:React Query Integration: Enhanced
query-client.tswith:suppressToastmeta option for custom handlingIPC Error Handling: Added
main/ipc-utils.tswith:safeHandle()wrapper that logs full stack traces in main processscreen:get-sources,app:get-version, andlink:fetch-metadatahandlersRefactoring:
ApiErrorfrom@/api/client.tsto@/lib/errors.ts(re-exported for back-compat)QuotaExceededErrorfrom@/hooks/use-create-particle.tsto@/lib/errors.ts(re-exported for back-compat)useCreateParticleto suppress global toast (compose UI handles custom quota UI)RouteErrorBoundaryTopLevelErrorBoundaryImproved Logging: Enhanced error logging in
main.tsfor link metadata fetching to track progressive enhancement failuresNotable Implementation Details
https://claude.ai/code/session_013pwtbUwCLQdwpJJDShi9aL