Closed dutu closed 8 years ago
Seem like something from Telegram.
What do you invoke before this appears?
That error happens whenever JSON.parse() gets HTML content as a parameter.
λ node
> JSON.parse('<htm>test</html>')
SyntaxError: Unexpected token < in JSON at position 0
at Object.parse (native)
at repl:1:6
at REPLServer.defaultEval (repl.js:272:27)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:441:10)
at emitOne (events.js:101:20)
at REPLServer.emit (events.js:188:7)
at REPLServer.Interface._onLine (readline.js:224:10)
at REPLServer.Interface._line (readline.js:566:8)
This is probably an API error w/o a try/catch block.
Hi @alxrm and @vlad-s, Thanks for your feedback. You're right. It looks that the fault is triggered by a response from telegram, when html is sent back instead of JSON & errorcode.
The fault seems to be due to incomplete error handling in TelegramAPI.js at https://github.com/Naltox/telegram-node-bot/blob/master/lib/api/TelegramApi.js#L94
Incomplete error handling is also causing issue #89.
Can we please have a response from devs on if/when can this be resolved, else I'd need to migrate to another framework (cannot afford bot to stop unexpectedly)
Thank you!
Same problem
Just updated module, think that will help
Bot stops responding and doesn't recover after error below is logged:
Restart of entire application is required to restore the functionality