-
Notifications
You must be signed in to change notification settings - Fork 232
feat: complete error code constants implementation #1413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…oP, and WebAuth operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR completes the error code constants implementation for type-safe error handling in react-native-auth0. It introduces exported error code constants (WebAuthErrorCodes, CredentialsManagerErrorCodes, DPoPErrorCodes) that developers can use for better autocomplete support and type safety when handling authentication errors.
- Exports error code constants for all three error types (WebAuth, CredentialsManager, DPoP)
- Adds comprehensive JSDoc documentation with usage examples
- Includes comprehensive test coverage for all error code constants
- Updates README with recommended usage patterns
- Provides working examples in the example app
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Exports error code constants alongside their corresponding error classes |
| src/exports/enums.ts | Re-exports error code constants for centralized enum access |
| src/core/models/index.ts | Updates exports to include error code constants from each error model |
| src/core/models/WebAuthError.ts | Adds comprehensive JSDoc and inline documentation for WebAuthErrorCodes constant |
| src/core/models/CredentialsManagerError.ts | Adds comprehensive JSDoc and inline documentation for CredentialsManagerErrorCodes constant |
| src/core/models/DPoPError.ts | Adds comprehensive JSDoc, inline documentation, and updates ERROR_CODE_MAP to reference DPoPErrorCodes constant |
| src/core/models/tests/ErrorCodes.spec.ts | New comprehensive test suite validating all error code constants, uniqueness, and usage patterns |
| example/src/screens/hooks/Home.tsx | Demonstrates WebAuthErrorCodes usage with type-safe switch statements for error handling |
| example/src/screens/hooks/CredentialsScreen.tsx | Demonstrates CredentialsManagerErrorCodes usage with type-safe switch statements for error handling |
| README.md | Adds recommended usage sections showing error code constants for both WebAuth and CredentialsManager errors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Completes the error code constants implementation from PR #1365
Usage
Related Issues
Resolves #1336