node-binance-api
node-binance-api copied to clipboard
How to catch errors of an order and execute some code if success ?
Hello,
I tried to catch errors with then()/catch()
like that
client.futuresMarketBuy('ETHUSDT', 100 )
.then(() => { execute_some_code })
.catch(err => console.log(err)
But I don't get any errors in console log in case fail nor the then() executed in case success
In summary I would like to execute some code in case of success of the promise or display the errors in the console like {code: -2019, msg: 'Margin is insufficient'}
Thank you :)