-
Notifications
You must be signed in to change notification settings - Fork 111
Update error strings #6103
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
base: master
Are you sure you want to change the base?
Update error strings #6103
Conversation
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 updates error messages for the trading/swap functionality to provide clearer and more user-friendly feedback. It refines existing error strings by splitting them into detailed and non-detailed variants, and removes the limit order suggestion text from base error messages while adding it to new detailed variants. The PR also cleans up several unused imports.
Changes:
- Refined error messages for swap/quote errors with clearer language (e.g., "No quotes available" instead of "No quote available")
- Added detailed error message variants that include limit order suggestions for specific error scenarios
- Introduced parameter formatting for
error_invalid_quote_amount_detailedto display maximum allowable amount dynamically - Removed unused imports from Kotlin files (RefreshOrdersJob, R, isWatch, OrderState, size)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Updated error messages with clearer wording and added detailed variants with limit order suggestions |
| app/src/main/res/values-zh-rCN/strings.xml | Chinese translations of the updated error messages |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapContent.kt | Enhanced error handling logic to use detailed error messages based on context, added quoteMax parameter for dynamic formatting |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/TradeFragment.kt | Removed unused RefreshOrdersJob import |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapViewModel.kt | Removed unused R and isWatch imports |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/OrderDetailFragment.kt | Removed unused OrderState import |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/LimitOrderContent.kt | Removed unused size import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| context.getString(R.string.error_no_quote_detailed) | ||
| } | ||
| ErrorHandler.INVALID_SWAP -> { | ||
| context.getString(R.string.error_trading_pair_not_supported_detailed) |
Copilot
AI
Jan 29, 2026
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.
Error code mapping is incorrect. ErrorHandler.NO_AVAILABLE_QUOTE (error code 10615) is being mapped to error_no_quote_detailed which has error code 10611, and ErrorHandler.INVALID_SWAP (error code 10611) is being mapped to error_trading_pair_not_supported_detailed which has error code 10615. The error codes in the displayed messages will not match the actual error codes, confusing users and support teams. The mappings should be swapped: NO_AVAILABLE_QUOTE should map to error_trading_pair_not_supported_detailed (both 10615) and INVALID_SWAP should map to error_no_quote_detailed (both 10611).
| context.getString(R.string.error_no_quote_detailed) | |
| } | |
| ErrorHandler.INVALID_SWAP -> { | |
| context.getString(R.string.error_trading_pair_not_supported_detailed) | |
| context.getString(R.string.error_trading_pair_not_supported_detailed) | |
| } | |
| ErrorHandler.INVALID_SWAP -> { | |
| context.getString(R.string.error_no_quote_detailed) |
No description provided.