Merge pull request #500 from influxdata/fix-server-no-return

Fix several handlers that were not returning after error
pull/504/head
Chris Goller 2016-11-11 13:02:51 -06:00 committed by GitHub
commit 10b18e579d
3 changed files with 3 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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{