Answer the question
In order to leave comments, you need to log in
Why does UnhandledPromiseRejectionWarning: Error: Request failed with status code 500 occur?
I run the code, but in the console it gives an error
UnhandledPromiseRejectionWarning: Error: Request failed with status
code 500
as well asessTicksAndRejections (internal/process/task_queues.js:82:21)
(node:9772) 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 termina
te the node process on unhandled promise rejection, use the CLI flag `--unhandle
d-rejections=strict`
require('dotenv').config();
const nft = require('./api/InfoNFT');
const userInfo = require('./api/getUserInfo');
const getPackInfo = require('./api/getPackInfo');
const buyCurrentBox = require('./api/buyCurrentBox');
main = async () => {
/*const nftInfo = await nft.getNft();
const ar = {};
nftInfo.map((item) => {
ar[item.name] = item.productId;
});
console.log(ar);
// console.log(nftInfo);
const user = await userInfo.getInfo();
console.log(user.data.data.email);
const packInfo = await getPackInfo('134199284294874112');
const packRes = packInfo.data.data;
//console.log(packInfo);
console.log(
`Pack Price ${packRes.price}\n Pack Name ${packRes.name}\n Limit ${packRes.limitPerTime}\n StartTime ${packRes.startTime}\n DELAY ${packRes.secondMarketSellingDelay}`
); */
buyCurrentBox('134199284294874112', 20).then((res) => console.log(res));
//console.log(buyCurrPack);
};
let resultTimeout = setInterval(() => main(), 50);
setTimeout(() => {
clearInterval(resultTimeout);
console.log('stop');
}, 9000);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question