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

Account with insufficient balance warning is scary #6

Closed
daddywookie opened this issue May 18, 2021 · 2 comments
Closed

Account with insufficient balance warning is scary #6

daddywookie opened this issue May 18, 2021 · 2 comments

Comments

@daddywookie
Copy link

Receiving the following warning is very scary

Error in executing buying volatiles function: "Error in executing buy function: {\"code\":-2010,\"msg\":\"Account has insufficient balance for requested action.\"}"

Maybe this can be caught and replaced with something friendlier?

Tried to buy but there was not enough funds available

@21jake
Copy link
Owner

21jake commented May 19, 2021

The message

{\"code\":-2010,\"msg\":\"Account has insufficient balance for requested action.\"}"

is an original message from Binance API, therefore we should not change it. They might inform this message or a different one, and it would be quite a mistake to assume that the error always comes from the balance having not enough funds.
In the future, I or someone might map our own responses accordingly to Binance's status code tho something like

const mapCodeToResponse = {
-2010: "Tried to buy but there was not enough funds available",
-2011: "Another response to another error"
...
}

But for now, the original message would be enough

@daddywookie
Copy link
Author

OK, I'll throw this in the "nice to have" pile for later

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

No branches or pull requests

2 participants