From eb604317c7047d1dc0af51e79892a7088c8bde2e Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Fri, 11 Nov 2016 12:52:34 -0600 Subject: [PATCH] Fix several handlers that were not returning after error --- server/exploration.go | 1 + server/layout.go | 1 + server/mappings.go | 1 + 3 files changed, 3 insertions(+) diff --git a/server/exploration.go b/server/exploration.go index 32dff2c05..23252106c 100644 --- a/server/exploration.go +++ b/server/exploration.go @@ -183,6 +183,7 @@ func (h *Service) NewExploration(w http.ResponseWriter, r *http.Request) { if err != nil { msg := fmt.Errorf("Error: Failed to save Exploration") unknownErrorWithMessage(w, msg) + return } res := newExploration(e) diff --git a/server/layout.go b/server/layout.go index 20b74e704..c9b38f1aa 100644 --- a/server/layout.go +++ b/server/layout.go @@ -45,6 +45,7 @@ func (h *Service) NewLayout(w http.ResponseWriter, r *http.Request) { if layout, err = h.LayoutStore.Add(r.Context(), layout); err != nil { msg := fmt.Errorf("Error storing layout %v: %v", layout, err) unknownErrorWithMessage(w, msg) + return } res := newLayoutResponse(layout) diff --git a/server/mappings.go b/server/mappings.go index 9037ee362..2917cc651 100644 --- a/server/mappings.go +++ b/server/mappings.go @@ -17,6 +17,7 @@ func (h *Service) GetMappings(w http.ResponseWriter, r *http.Request) { layouts, err := h.LayoutStore.All(ctx) if err != nil { Error(w, http.StatusInternalServerError, "Error loading layouts") + return } mp := getMappingsResponse{