Skip to content

Commit

Permalink
Warn when post not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Dec 28, 2023
1 parent 46e2959 commit 605ab14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions handlers/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
data "instafix/handlers/data"

"github.com/gofiber/fiber/v2"
"github.com/rs/zerolog/log"
"github.com/valyala/bytebufferpool"
)

Expand Down Expand Up @@ -91,6 +92,7 @@ func Embed() fiber.Handler {
views.Embed(viewsData, viewsBuf)
return c.Send(viewsBuf.Bytes())
} else if len(item.Username) == 0 {
log.Warn().Str("postID", postID).Msg("Post not found")
viewsData.Description = "Post not found"
views.Embed(viewsData, viewsBuf)
return c.Send(viewsBuf.Bytes())
Expand Down

0 comments on commit 605ab14

Please sign in to comment.