Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Improve error handling in transferCrossChain command #8650

Closed
Tracked by #7226
ishantiw opened this issue Jun 23, 2023 · 0 comments
Closed
Tracked by #7226

Improve error handling in transferCrossChain command #8650

ishantiw opened this issue Jun 23, 2023 · 0 comments

Comments

@ishantiw
Copy link
Contributor

Description

The token module throws error messages that are duplicated in multiple parts of the code. For example errors related to lack of account balance are repeated in /token/commands/transfer.ts#L57, /token/internal_method.ts#L78, token/commands/transfer_cross_chain.ts#L113, and /token/commands/transfer_cross_chain.ts#L158. Instead of hardcoding the same error message in many locations, consider creating a custom exception that receives the necessary parameters (e.g. sender address, amount) and creates the error message. Then at each location throw the custom exception.

Which version(s) does this affect? (Environment, OS, etc...)

v6.0.0-beta.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants