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



##########
File path: traffic_ops/traffic_ops_golang/profile/profiles.go
##########
@@ -21,11 +21,12 @@ package profile
 
 import (
        "errors"
-       
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/util/ims"
        "net/http"
        "strconv"
        "time"
 
+       
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/util/ims"
+

Review comment:
       extraneous space

##########
File path: traffic_ops/traffic_ops_golang/profile/profiles.go
##########
@@ -149,7 +150,7 @@ func (prof *TOProfile) Read(h http.Header, useIMS bool) 
([]interface{}, error, e
 
        rows, err := prof.ReqInfo.Tx.NamedQuery(query, queryValues)
        if err != nil {
-               return nil, nil, errors.New("profile read querying: " + 
err.Error()), http.StatusInternalServerError, nil
+               return nil, errors.New("bad request found"), 
errors.New("profile read querying: " + err.Error()), http.StatusBadRequest, nil

Review comment:
       So if you use 
`github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseDBError`
 you can get possibly some more information that will help the client correct 
their request, rather than just telling them it was bad.




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