depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

Fix for #42 #43

Closed longstone closed 8 years ago

longstone commented 9 years ago

Checks if statusCode is defined before access it, otherwise, logs the error stacktrace. Handling response error crashes #42

sebastianarena commented 8 years ago

@longstone @shernshiou giving it a little more look at the debug, it seems not handling the res properly gave me a little light on something else. Why is the library calling _setWebhook on stop when it doesn't need to? On start there's a check to call that, but on stop it's being called everytime with "" which I think might be the reason behind the crash.

sebastianarena commented 8 years ago

@shernshiou any ideas on this? Do you think you can merge this pull request?

shernshiou commented 8 years ago

@kaminoo I have merge can u check again whether it works as expected?

sebastianarena commented 8 years ago

@shernshiou thanks! checking this will take a couple of days, since I'll have to update the production server where this error occurs. It has happened in development, but it's hard to come by (probably why you didn't see it). I'll deploy it in the next days probably and let you know if it works as expected or not.