Skip to content

feat: Improve error messages for token transfers#93

Open
Uchechukwu-Ekezie wants to merge 1 commit into
DeborahOlaboye:mainfrom
Uchechukwu-Ekezie:feat/improve-token-transfer-error-messages
Open

feat: Improve error messages for token transfers#93
Uchechukwu-Ekezie wants to merge 1 commit into
DeborahOlaboye:mainfrom
Uchechukwu-Ekezie:feat/improve-token-transfer-error-messages

Conversation

@Uchechukwu-Ekezie
Copy link
Copy Markdown
Contributor

  • Add token transfer specific error types to ContractErrorType enum
  • Enhance parseContractError to handle ERC20 transfer errors with specific messages
  • Improve error messages in useTokenApproval hook with actionable guidance
  • Update error handling in play page and rewards page for better UX
  • Add comprehensive tests for error detection and parsing
  • Create ERROR_HANDLING.md documentation

Error types added:

  • INSUFFICIENT_TOKEN_BALANCE
  • INSUFFICIENT_ALLOWANCE
  • TOKEN_TRANSFER_FAILED
  • TOKEN_APPROVAL_FAILED
  • TOKEN_APPROVAL_REJECTED
  • ZERO_AMOUNT_TRANSFER
  • TRANSFER_TO_ZERO_ADDRESS

All error messages are now user-friendly, actionable, and provide clear guidance on how to resolve issues.

- Add token transfer specific error types to ContractErrorType enum
- Enhance parseContractError to handle ERC20 transfer errors with specific messages
- Improve error messages in useTokenApproval hook with actionable guidance
- Update error handling in play page and rewards page for better UX
- Add comprehensive tests for error detection and parsing
- Create ERROR_HANDLING.md documentation

Error types added:
- INSUFFICIENT_TOKEN_BALANCE
- INSUFFICIENT_ALLOWANCE
- TOKEN_TRANSFER_FAILED
- TOKEN_APPROVAL_FAILED
- TOKEN_APPROVAL_REJECTED
- ZERO_AMOUNT_TRANSFER
- TRANSFER_TO_ZERO_ADDRESS

All error messages are now user-friendly, actionable, and provide clear guidance on how to resolve issues.
@Uchechukwu-Ekezie
Copy link
Copy Markdown
Contributor Author

please review

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.

1 participant