fix: unsilence all error returns from SQL Exec, Bot API calls, and migrations

This commit is contained in:
2026-06-24 20:03:24 +03:30
parent 4165839477
commit e7e4dc7bfe
8 changed files with 227 additions and 193 deletions

View File

@@ -61,7 +61,9 @@ func main() {
if url := os.Getenv("BOT_WEBHOOK_URL"); url != "" {
startWebhook(ctx, b, h, url)
} else {
b.DeleteWebhook(ctx, &tgbot.DeleteWebhookParams{})
if _, err := b.DeleteWebhook(ctx, &tgbot.DeleteWebhookParams{}); err != nil {
slog.Warn("failed to delete webhook", "error", err)
}
go dailyReportScheduler(ctx, h, dbStore)
slog.Info("bot started",
"allowed_users", len(allowedUsers),
@@ -105,6 +107,7 @@ func checkDailyReports(ctx context.Context, h *bot.Handler, store *db.Store) {
loc, err := time.LoadLocation(u.Timezone)
if err != nil {
slog.Error("invalid timezone for user, skipping report", "chat_id", u.ChatID, "timezone", u.Timezone, "error", err)
continue
}
localNow := now.In(loc)