rimashah25 commented on code in PR #6593:
URL: https://github.com/apache/trafficcontrol/pull/6593#discussion_r856339834


##########
traffic_ops/traffic_ops_golang/server/detail.go:
##########
@@ -91,7 +91,11 @@ func GetDetailParamHandler(w http.ResponseWriter, r 
*http.Request) {
                                routerPortName = interfaces[0].RouterPortName
                        }
                        v11server := tc.ServerDetailV11{}
-                       v11server.ServerDetail = server.ServerDetail
+                       v11server.ServerDetail, err = 
dbhelpers.GetServerDetailFromV4(server, inf.Tx.Tx)
+                       if err != nil {
+                               api.HandleErr(w, r, inf.Tx.Tx, 
http.StatusBadRequest, nil, errors.New("failed to GetServerDetailFromV4: 
"+err.Error()))

Review Comment:
   @ocket8888: I don't understand, why I need to use `fmt.Errorf` instead of 
`errors.New`. In my understanding fmt gives me a string format and errors gives 
me error type.
   I agree on the status code change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to