External replica proxy

This commit is contained in:
Alex Ellis
2017-07-27 19:37:55 +01:00
parent 33381a783a
commit f165ce2ca7
5 changed files with 92 additions and 9 deletions

View File

@ -115,16 +115,16 @@ func MakeAlertHandler(sq ServiceQuery) http.HandlerFunc {
errors := handleAlerts(&req, sq)
if len(errors) > 0 {
log.Println(errors)
w.WriteHeader(http.StatusInternalServerError)
var errorOutput string
for d, err := range errors {
errorOutput += fmt.Sprintf("[%d] %s\n", d, err)
}
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(errorOutput))
} else {
w.WriteHeader(http.StatusOK)
return
}
w.WriteHeader(http.StatusOK)
}
}