From 54ff49522efde5d566ded70d6e11096083050c87 Mon Sep 17 00:00:00 2001 From: Feroze Mohideen Date: Mon, 30 Oct 2023 17:46:39 -0400 Subject: [PATCH] set empty response if no images found rather than error --- api/server/handlers/project/images.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/server/handlers/project/images.go b/api/server/handlers/project/images.go index cc5d9c74f4..595be29934 100644 --- a/api/server/handlers/project/images.go +++ b/api/server/handlers/project/images.go @@ -62,6 +62,7 @@ func (p *ImagesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } var resp ImagesReponse + resp.Images = make([]Image, 0) imagesReq := connect.NewRequest(&porterv1.ImagesRequest{ ProjectId: int64(project.ID), @@ -83,9 +84,8 @@ func (p *ImagesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { p.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusInternalServerError)) return } - if ccpResp.Msg.Images == nil { - err := telemetry.Error(ctx, span, err, "ccp resp msg images is nil") - p.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusInternalServerError)) + if ccpResp.Msg.Images == nil { // this means that no images were returned + p.WriteResult(w, r, resp) return }