Bug Report
I have read:
I am using the latest version of the library.
Im trying that bot working 24/7 and not show not expected errors.
Unhandled rejection TypeError: Cannot read property 'statusCode' of undefined
at request.catch.err (D:\tg_bot\node_modules\node-telegram-bot-api\src\telegramPolling.js:148:25)
at tryCatcher (D:\tg_bot\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\tg_bot\node_modules\bluebird\js\release\promise.js:510:31)
at Promise._settlePromise (D:\tg_bot\node_modules\bluebird\js\release\promise.js:567:18)
at Promise._settlePromise0 (D:\tg_bot\node_modules\bluebird\js\release\promise.js:612:10)
at Promise._settlePromises (D:\tg_bot\node_modules\bluebird\js\release\promise.js:687:18)
at Async._drainQueue (D:\tg_bot\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (D:\tg_bot\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (D:\tg_bot\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
$ node -v
v7.4.0
$ npm -v
4.0.5
Windows 10 - 64bit - if it important.
package.json:
{
"name": "tg_bot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"mysql": "^2.13.0",
"node-telegram-bot-api": "^0.26.0",
"request": "^2.79.0"
}
}
Almost the same here:
Unhandled rejection TypeError: Cannot read property 'statusCode' of undefined
data: index.js:10692 - at request.catch.err (node_modules/node-telegram-bot-api/src/telegramPolling.js:148:25)
data: index.js:10692 - at runCallback (timers.js:649:20)
data: index.js:10692 - at tryOnImmediate (timers.js:622:5)
data: index.js:10692 - at processImmediate [as _immediateCallback] (timers.js:594:5)
data: index.js:10692 - From previous event:
data: index.js:10692 - at TelegramBotPolling._getUpdates (node_modules/node-telegram-bot-api/src/telegramPolling.js:147:13)
data: index.js:10692 - at TelegramBotPolling._polling (node_modules/node-telegram-bot-api/src/telegramPolling.js:98:8)
data: index.js:10692 - at Timeout._pollingTimeout.setTimeout [as _onTimeout] (node_modules/node-telegram-bot-api/src/telegramPolling.js:117:56)
data: index.js:10692 - at ontimeout (timers.js:365:14)
data: index.js:10692 - at tryOnTimeout (timers.js:237:5)
data: index.js:10692 - at Timer.listOnTimeout (timers.js:207:5)
Linux 3.14.79 armv7l GNU/Linux
node 6.9.5
npm 3.10.9
node-telegram-bot 0.26.0
Just pushed a fix for this in commit 7e4cadb514346f1fc7262fb445363b9ab9beeec2. Please try it out and let us know of the results.
Fixed in v0.27.0.
Thanks @dimawebmaker and @the-AjK for your time and effort in fixing this bug.
Most helpful comment
Fixed in v0.27.0.
Thanks @dimawebmaker and @the-AjK for your time and effort in fixing this bug.