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) { ...@@ -104,9 +104,7 @@ func (i *apiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
res := commands.Root.Call(req) res := commands.Root.Call(req)
// if response contains an error, write an HTTP error status code // if response contains an error, write an HTTP error status code
if err = res.Error(); err != nil { if e := res.Error(); e != nil {
e := err.(cmds.Error)
if e.Code == cmds.ErrClient { if e.Code == cmds.ErrClient {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
} else { } 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