Errors in image format (closes #165)

This commit is contained in:
video-prize-ranch
2024-02-04 21:24:55 -05:00
parent 6d528c7d0a
commit 1579e59dca
11 changed files with 73 additions and 64 deletions

View File

@@ -26,14 +26,12 @@ func HandlePost(c *fiber.Ctx) error {
post, err = ApiClient.FetchMedia(c.Params("postID"))
}
if err != nil && err.Error() == "ratelimited by imgur" {
return c.Status(429).Render("errors/429", fiber.Map{
"path": c.Path(),
})
return utils.RenderError(c, 429)
}
if err != nil && post.Id == "" && strings.Contains(err.Error(), "404") {
return c.Status(404).Render("errors/404", nil)
return utils.RenderError(c, 404)
}
if err != nil {
if err != nil {
return err
}