fixed redundant error handling
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user