Skip to content

Commit

Permalink
handle error when gallery is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed Dec 2, 2024
1 parent 9a613e8 commit 0a719b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stiller-backend/internal/handlers/get_gallery_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ func GetGalleryDetail(w http.ResponseWriter, r *http.Request, params httprouter.
Args: get_gallery.Args(),
})

if gallery.Id == 0 {
loggers.RequestLog(nil, "gallery not found", http.StatusNotFound, &w)
return
}

if loggers.RequestLog(exec_err, "", http.StatusInternalServerError, &w) {
return
}
Expand Down

0 comments on commit 0a719b4

Please sign in to comment.