don't panic for failed updates, even in debug (fixes #14)
parent
adc490e379
commit
d06eead68d
10
updates.go
10
updates.go
|
@ -13,13 +13,9 @@ func (bot *BotAPI) UpdatesChan(config UpdateConfig) error {
|
||||||
for {
|
for {
|
||||||
updates, err := bot.GetUpdates(config)
|
updates, err := bot.GetUpdates(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if bot.Debug {
|
log.Println(err)
|
||||||
panic(err)
|
log.Println("Failed to get updates, retrying in 3 seconds...")
|
||||||
} else {
|
time.Sleep(time.Second * 3)
|
||||||
log.Println(err)
|
|
||||||
log.Println("Failed to get updates, retrying in 3 seconds...")
|
|
||||||
time.Sleep(time.Second * 3)
|
|
||||||
}
|
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue