fix: error handling was missing

This commit is contained in:
Adora Laura Kalb 2024-11-05 11:57:45 +01:00
parent 50b72241f7
commit 22aa16e957
Signed by: adoralaura
SSH key fingerprint: SHA256:3XrkbR8ikAZJVtYfaUliX1MhmJYVAe/ocIb/MiDHBJ8

View file

@ -7,10 +7,11 @@
package app package app
import ( import (
"codeberg.org/lauralani/humble-bot/db"
"codeberg.org/lauralani/humble-bot/models"
"context" "context"
"database/sql" "database/sql"
"codeberg.org/lauralani/humble-bot/db"
"codeberg.org/lauralani/humble-bot/models"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
) )
@ -35,8 +36,11 @@ func RunSingleQueueItem() {
err = postQueueItemToMastodon(item) err = postQueueItemToMastodon(item)
if err != nil { if err != nil {
log.Error().Str("bundle-name", item.Name).Int64("bundle-id", item.ID).
Str("bundle-url", item.URL).Msg("failed to post new bundle!")
return return
} }
log.Debug().Str("func", "RunSingleQueueItem").Str("item", item.Name). log.Debug().Str("func", "RunSingleQueueItem").Str("item", item.Name).
Msg("posted to mastodon") Msg("posted to mastodon")