(new): webhook + payload error sentinels
(fix): polling panic ErrorEvent, nil-logger guard (refactor): inline webhook errors → sentinels, dead Runner branch (doc): Runner godoc, Error godoc, drafts cleanup
This commit is contained in:
@@ -449,6 +449,17 @@ func (bot *Bot[T]) RunWithContext(ctx context.Context) error {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
bot.logger.Errorln(fmt.Sprintf("panic in update polling: %v", r))
|
||||
err, ok := r.(error)
|
||||
if !ok {
|
||||
err = fmt.Errorf("%v", r)
|
||||
}
|
||||
bot.safeEmitEvent(ctx, ErrorEvent{
|
||||
Plugin: "bot",
|
||||
HandlerKind: HandlerPollingKind,
|
||||
HandlerName: "getUpdates",
|
||||
Err: err,
|
||||
UserFacing: false,
|
||||
})
|
||||
}
|
||||
close(bot.updateQueue)
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user