node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

How to catch errors of an order and execute some code if success ?

Open joyboy67 opened this issue 2 years ago • 0 comments

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 :)

joyboy67 avatar Apr 24 '22 16:04 joyboy67