benjick / meteor-telegram-bot

Telegram bot plugin for Meteor
24 stars 15 forks source link

Error on startup #31

Open elie222 opened 8 years ago

elie222 commented 8 years ago

You can get this error on startup that will stop your entire Meteor app from running:

W20160905-14:58:06.877(3)? (STDERR) TypeError: Cannot read property '401' of undefined
W20160905-14:58:06.878(3)? (STDERR)     at packages/benjick:telegram-bot/telegram-bot.js:92:21
W20160905-14:58:06.878(3)? (STDERR)     at Array.map (native)
W20160905-14:58:06.878(3)? (STDERR)     at Object.TelegramBot.parsePollResult (packages/benjick:telegram-bot/telegram-bot.js:45:7)
W20160905-14:58:06.879(3)? (STDERR)     at Object.TelegramBot.poll (packages/benjick:telegram-bot/telegram-bot.js:32:15)
W20160905-14:58:06.879(3)? (STDERR)     at Object.TelegramBot.start (packages/benjick:telegram-bot/telegram-bot.js:36:14)

I'm going to look into it now. To get to the situation is an edge case and I think I got here from sending Telegram a bad request, but either way this shouldn't crash the entire app.

elie222 commented 8 years ago

I made a pull request to fix this issue here: https://github.com/benjick/meteor-telegram-bot/pull/32