This is an automated email from the ASF dual-hosted git repository.

dgelinas pushed a commit to branch 3.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/3.0.x by this push:
     new c5ced13  Fix TO Go cdnfeds empty/error codes&msgs (#2857) (#3704)
c5ced13 is described below

commit c5ced137a099b8fa1501d77a6d71db78aa973c5b
Author: Jeremy Mitchell <[email protected]>
AuthorDate: Fri Jun 28 12:55:46 2019 -0600

    Fix TO Go cdnfeds empty/error codes&msgs (#2857) (#3704)
    
    (cherry picked from commit f5b344d3d253ff81fa98dc16f6ae23949b7feda8)
---
 traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go 
b/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
index 692abc8..91a71dc 100644
--- a/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
+++ b/traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
@@ -198,13 +198,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

Reply via email to