Fix JSON syntax error in generated errors

This commit is contained in:
nemunaire 2017-10-26 14:17:01 +02:00
parent 9b27a67a21
commit b690cec690
1 changed files with 1 additions and 1 deletions

2
api.go
View File

@ -79,7 +79,7 @@ func (a apiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if j, err := json.Marshal(ret); err != nil {
http.Error(w, fmt.Sprintf("{errmsg:\"%q\"}", err), http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("{errmsg:%q}", err), http.StatusInternalServerError)
} else {
w.WriteHeader(resStatus)
w.Write(j)