Skip to content
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

Inconsistent Error Handling in wallets.js #199

Open
BrosG opened this issue May 24, 2023 · 0 comments
Open

Inconsistent Error Handling in wallets.js #199

BrosG opened this issue May 24, 2023 · 0 comments

Comments

@BrosG
Copy link
Contributor

BrosG commented May 24, 2023

The error handling in the file wallets.js is currently inconsistent. For instance, in the functions addWalletTron, getWalletTron, getWalletTronV2, wrapNative and unWrapNative, there are different ways of dealing with errors. This can lead to confusion when trying to debug the application, and it can make it harder to ensure that all errors are handled appropriately.

Suggestion: Implement a consistent error handling strategy across all functions. This could be done by defining a standard for how errors should be caught and handled. It might involve creating a custom error class that can hold additional information about the error, or wrapping all function bodies in a try/catch block and using a centralized error handling middleware to handle all errors.

Verification: Once the changes are implemented, you should verify that all functions in wallets.js follow the same error handling strategy. You could do this by reviewing the code and running tests to confirm that errors are handled correctly.

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

No branches or pull requests

1 participant