ocket8888 commented on a change in pull request #5922:
URL: https://github.com/apache/trafficcontrol/pull/5922#discussion_r651803739



##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go
##########
@@ -1070,87 +1259,103 @@ func updateV40(w http.ResponseWriter, r *http.Request, 
inf *api.APIInfo, dsV40 *
 
        if err != nil {
                usrErr, sysErr, code := api.ParseDBError(err)
-               return nil, code, usrErr, sysErr
+               return nil, alerts, code, usrErr, sysErr
        }
        defer resultRows.Close()
        if !resultRows.Next() {
-               return nil, http.StatusNotFound, errors.New("no delivery 
service found with this id"), nil
+               return nil, alerts, http.StatusNotFound, errors.New("no 
delivery service found with this id"), nil
        }
-       lastUpdated := tc.TimeNoMod{}
+       var lastUpdated time.Time
        if err := resultRows.Scan(&lastUpdated); err != nil {
-               return nil, http.StatusInternalServerError, nil, 
errors.New("scan updating delivery service: " + err.Error())
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("scan updating delivery service: " + err.Error())
        }
        if resultRows.Next() {
                xmlID := ""
                if ds.XMLID != nil {
                        xmlID = *ds.XMLID
                }
-               return nil, http.StatusInternalServerError, nil, 
errors.New("updating delivery service " + xmlID + ": " + "this update affected 
too many rows: > 1")
-       }
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("updating delivery service " + xmlID + ": " + "this update affected 
too many rows: > 1")
 
+       }
        if ds.ID == nil {
-               return nil, http.StatusInternalServerError, nil, 
errors.New("missing id after update")
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("missing id after update")
        }
        if ds.XMLID == nil {
-               return nil, http.StatusInternalServerError, nil, 
errors.New("missing xml_id after update")
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("missing XMLID after update")
        }
        if ds.TypeID == nil {
-               return nil, http.StatusInternalServerError, nil, 
errors.New("missing type after update")
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("missing type id after update")
        }
        if ds.RoutingName == nil {
-               return nil, http.StatusInternalServerError, nil, 
errors.New("missing routing name after update")
+               return nil, alerts, http.StatusInternalServerError, nil, 
errors.New("missing routing name after update")
+       }
+
+       if resultRows.Next() {

Review comment:
       We don't, looks like a bad rebase.




-- 
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.

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


Reply via email to