Skip to main content

Error Handling

This guide covers error types and handling strategies in the Privacy Boost TypeScript SDK.

Error Types

All SDK errors extend from PrivacyBoostError:

Error Categories

Configuration Errors

Wallet Errors

Authentication Errors

Operation Errors

Network Errors

Proof Errors

Error Handling Patterns

Basic Try-Catch

Error Handler Function

Retry Logic

Session Refresh

React Error Boundary

React Hook for Error Handling

Logging Errors

Best Practices

1. Always Handle User Rejections Gracefully

2. Provide Actionable Error Messages

3. Log Errors for Debugging

4. Use Error Codes, Not Messages

Next Steps