depoio / node-telegram-bot

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

Handle Telegram outage gracefully #16

Closed Christilut closed 9 years ago

Christilut commented 9 years ago

Telegram was under DDOS yesterday and my bots got this error:

{ [Error: socket hang up] code: 'ECONNRESET' }

I think the best place to handle this is in your library. Maybe retry until connectable again? Is there a on-error event?

shernshiou commented 9 years ago

Good suggestion. I will implement the retry at open method. Thanks

shernshiou commented 9 years ago

@Christilut hey, you can now adjust maxattempt. Default attempt will be 5 times.