Вот мой код:
function relOnline() {
util.status('test')
.then((response) => {
if (response.onlinePlayers > botOnlineMatch.maxOnline) {
botOnlineMatch.maxOnline = response.onlinePlayers
}
if (response.onlinePlayers > botOnlineMatch.dayOnline) {
botOnlineMatch.dayOnline = response.onlinePlayers
}
})
}
setInterval(relOnline, 500)
В консоли появляется ошибка:
node:internal/process/promises:227
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: 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(). The promise rejected with the reason "undefined".] {
code: 'ERR_UNHANDLED_REJECTION'
}
С чем это может быть связано и как это можно исправить?