You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/08/05 18:05:08 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #3771: Add consistent audit log messages to TO Go

ocket8888 commented on a change in pull request #3771: Add consistent audit log messages to TO Go
URL: https://github.com/apache/trafficcontrol/pull/3771#discussion_r310723278
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/federations/ds.go
 ##########
 @@ -40,6 +41,12 @@ func PostDSes(w http.ResponseWriter, r *http.Request) {
 	defer inf.Close()
 
 	fedID := inf.IntParams["id"]
+	fedName, ok, err := getFedNameByID(inf.Tx.Tx, fedID)
+	if err != nil {
+		api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError, nil, errors.New("getting federation cname from ID '"+string(fedID)+"': "+err.Error()))
+	} else if !ok {
+		api.HandleErr(w, r, inf.Tx.Tx, http.StatusBadRequest, errors.New("federation not found: "+err.Error()), nil)
 
 Review comment:
   Shouldn't this be using `http.StatusNotFound`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services