mitchell852 closed pull request #2857: Fixes TO cdn/federations to return []
not null
URL: https://github.com/apache/trafficcontrol/pull/2857
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
b/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
index 28317cb71..19ff6a825 100644
--- a/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
+++ b/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
@@ -180,13 +180,13 @@ func (fed *TOCDNFederation) Read() ([]interface{}, error,
error, int) {
}
if len(filteredFederations) == 0 {
- if fed.ID == nil {
- return nil, nil, nil, http.StatusNotFound
+ if fed.ID != nil {
+ return nil, errors.New("not found"), nil,
http.StatusNotFound
}
if ok, err := dbhelpers.CDNExists(fed.APIInfo().Params["name"],
fed.APIInfo().Tx); err != nil {
return nil, nil, errors.New("verifying CDN exists: " +
err.Error()), http.StatusInternalServerError
} else if !ok {
- return nil, nil, nil, http.StatusNotFound
+ return nil, errors.New("cdn not found"), nil,
http.StatusNotFound
}
}
return filteredFederations, nil, nil, http.StatusOK
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services