better error message

This commit is contained in:
Chris Lu 2012-11-13 12:13:12 -08:00
parent b23e51f205
commit 6f606bb350

View file

@ -153,11 +153,13 @@ func volumeGrowHandler(w http.ResponseWriter, r *http.Request) {
} else { } else {
count, err = vg.GrowByCountAndType(count, rt, topo) count, err = vg.GrowByCountAndType(count, rt, topo)
} }
}else{
err = errors.New("parameter count is not found")
} }
} }
if err != nil { if err != nil {
w.WriteHeader(http.StatusNotAcceptable) w.WriteHeader(http.StatusNotAcceptable)
writeJson(w, r, map[string]string{"error": err.Error()}) writeJson(w, r, map[string]string{"error": "parameter replication "+err.Error()})
} else { } else {
w.WriteHeader(http.StatusNotAcceptable) w.WriteHeader(http.StatusNotAcceptable)
writeJson(w, r, map[string]interface{}{"count": count}) writeJson(w, r, map[string]interface{}{"count": count})