don't panic for failed updates, even in debug (fixes #14)

bot-api-6.1
Syfaro 2015-08-09 21:12:15 -05:00
parent adc490e379
commit d06eead68d
1 changed files with 3 additions and 7 deletions

View File

@ -13,13 +13,9 @@ func (bot *BotAPI) UpdatesChan(config UpdateConfig) error {
for {
updates, err := bot.GetUpdates(config)
if err != nil {
if bot.Debug {
panic(err)
} else {
log.Println(err)
log.Println("Failed to get updates, retrying in 3 seconds...")
time.Sleep(time.Second * 3)
}
log.Println(err)
log.Println("Failed to get updates, retrying in 3 seconds...")
time.Sleep(time.Second * 3)
continue
}