Fix JSON syntax error in generated errors
This commit is contained in:
parent
9b27a67a21
commit
b690cec690
2
api.go
2
api.go
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue