From 487299f09cf877a413eccecd9db4c8db4c005208 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Thu, 14 Jan 2021 11:32:22 +0100 Subject: [PATCH] kojiapi: Job not found should return 404 Not Found (404) is a more appropriate code for requesting a valid (correctly formatted) UUID that doesn't exist in the job queue. --- internal/kojiapi/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/kojiapi/server.go b/internal/kojiapi/server.go index 4210ae063..a7b2c5089 100644 --- a/internal/kojiapi/server.go +++ b/internal/kojiapi/server.go @@ -303,7 +303,7 @@ func (h *apiHandlers) GetComposeId(ctx echo.Context, idstr string) error { var finalizeResult worker.KojiFinalizeJobResult finalizeStatus, deps, err := h.server.workers.JobStatus(id, &finalizeResult) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Job %s not found: %s", idstr, err)) + return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Job %s not found: %s", idstr, err)) } // Make sure deps[0] matches a KojiInitJob