I am getting mysterious error when I try to place a market order using node-binance-api by using the following function, any suggestion is greatly appreciated!
the error I am getting is:
(node:17200) UnhandledPromiseRejectionWarning: #
(node:17200) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17200) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Thank you for your response. I tried both methods you have mentioned in your comment as showing below, I am still getting the same error. Any suggestion? Thank you so much!
I tried the code you posted and now I am getting node:14868 error. I searched, I concluded that the issue should related with the code because node js error message is just indicator that there is an error in the code. I don’t have another alternative to replace node js. I have been working on this code for at least three months. I learned js and now I am comfortable using it. Do you know a group or threat might help me,
there is an example on node-binance-api to place an order. Do you have any idea how to adapt it to solve my problem ? Thank you so much
Now after using the .catch… the one you suggested, I stop receving the node js error. However, now I started to see a response as shown in the attached pic. I snipped shot only part of the message because it too long
I think I know why you got that error msg;
Please update the code to be like this:
binance.marketBuy(<your trading pair>,<your quantity>).then(resp => console.log(resp)).catch(err => console.log(err.body))