Commit 3ae6117c authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

server/http: Don't cast res.Error() to an Error (fixes panix on response errors)

parent 73353824
......@@ -104,9 +104,7 @@ func (i *apiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
res := commands.Root.Call(req)
// if response contains an error, write an HTTP error status code
if err = res.Error(); err != nil {
e := err.(cmds.Error)
if e := res.Error(); e != nil {
if e.Code == cmds.ErrClient {
w.WriteHeader(http.StatusBadRequest)
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment