(new): webhook + payload error sentinels
Golang lint / lint (push) Successful in 2m46s
Golang lint / lint (pull_request) Successful in 2m47s

(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:
2026-05-20 12:30:44 +03:00
parent 61d0b1ebb8
commit 8a3f2cedf2
9 changed files with 81 additions and 59 deletions
+7 -2
View File
@@ -496,7 +496,7 @@ func (ctx *MessageContext) AnswerCallbackURL(u string) { ctx.answerCallbackQuery
// SendAction sends a chat action (typing, uploading_photo, etc.) to indicate bot activity.
func (ctx *MessageContext) SendAction(action tgapi.ChatActionType) {
if ctx.Msg == nil {
ctx.Logger.Errorln("Can't send action without chat message context")
ctx.Logger.Errorln(ErrMessageContextNil)
return
}
params := tgapi.SendChatAction{
@@ -528,7 +528,12 @@ func (ctx *MessageContext) error(err error) {
}
}
// Error routes err through the centralized handler error path
// Error routes err through the centralized handler error path.
//
// The error is logged via ctx.Logger. When IsUserError(err) is true, the
// formatted error template is delivered to the user — through an answer
// to the active callback query when one exists, otherwise as a chat reply.
// Internal errors are logged but not surfaced to the user.
func (ctx *MessageContext) Error(err error) { ctx.error(err) }
func (ctx *MessageContext) newDraft(parseMode tgapi.ParseMode) *Draft {