Package list golang-github-go-kit-kit / a0602ce
Remove nil error case encodeError should not even be called when err != nil. Marcus Olsson 5 years ago
3 changed file(s) with 0 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
186186 // encode errors from business-logic
187187 func encodeError(w http.ResponseWriter, err error) {
188188 switch err {
189 case nil:
190 w.WriteHeader(http.StatusOK)
191189 case cargo.ErrUnknown:
192190 w.WriteHeader(http.StatusNotFound)
193191 case ErrInvalidArgument:
8585 // encode errors from business-logic
8686 func encodeError(w http.ResponseWriter, err error) {
8787 switch err {
88 case nil:
89 w.WriteHeader(http.StatusOK)
9088 case cargo.ErrUnknown:
9189 w.WriteHeader(http.StatusNotFound)
9290 case ErrInvalidArgument:
5959 // encode errors from business-logic
6060 func encodeError(w http.ResponseWriter, err error) {
6161 switch err {
62 case nil:
63 w.WriteHeader(http.StatusOK)
6462 case cargo.ErrUnknown:
6563 w.WriteHeader(http.StatusNotFound)
6664 case ErrInvalidArgument: