fixed redundant error handling
This commit is contained in:
parent
8d178d0541
commit
065b0d2cc6
12
api.go
12
api.go
@ -69,12 +69,6 @@ func (s *Server) category(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.Error(w, string(b), http.StatusInternalServerError)
|
http.Error(w, string(b), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
log.Printf("%+v", err)
|
|
||||||
b, _ := json.Marshal(NewFailure(err.Error()))
|
|
||||||
http.Error(w, string(b), http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,11 +173,5 @@ func (s *Server) user(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.Error(w, string(b), http.StatusInternalServerError)
|
http.Error(w, string(b), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
log.Printf("%+v", err)
|
|
||||||
b, _ := json.Marshal(NewFailure(err.Error()))
|
|
||||||
http.Error(w, string(b), http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user