From 39213020e2529567874634286f56009943b094f6 Mon Sep 17 00:00:00 2001 From: sneak Date: Sat, 4 Apr 2020 18:40:34 -0700 Subject: [PATCH] instance handler tweaks --- process/handlers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/process/handlers.go b/process/handlers.go index 972d9c0..79e46c9 100644 --- a/process/handlers.go +++ b/process/handlers.go @@ -96,20 +96,20 @@ func (a *Server) instanceHandler(c echo.Context) error { tu := c.Param("uuid") u, err := uuid.Parse(tu) if err != nil { - return c.String(http.StatusNotFound, "404 not found") + return a.notFoundHandler(c) } tc := pongo2.Context{} instances := a.feta.manager.ListInstances() + found := false for _, item := range instances { if item.UUID == u { tc["instance"] = item + found = true } } - _, exists := tc["instance"] - - if !exists { + if !found { return a.notFoundHandler(c) }