mhoppa commented on a change in pull request #4072: Prevent Assigning Servers 
to Delivery Services Without Required Capabilities
URL: https://github.com/apache/trafficcontrol/pull/4072#discussion_r342247899
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##########
 @@ -447,7 +447,7 @@ func GetCreateHandler(w http.ResponseWriter, r 
*http.Request) {
 }
 
 // ValidateServerCapabilities checks that the delivery service's requirements 
are met by each server to be assigned.
-func ValidateServerCapabilities(dsID int, serverNames []string, tx *sql.Tx) 
(error, error) {
+func ValidateServerCapabilities(dsID int, serverNames []string, tx *sql.Tx) 
(error, int) {
 
 Review comment:
   So I think on this and the other Validation method you want to have the 
return of `(err, err, int)`
   
   The function you are using in the caller `api.HandleErr` if you notice is 
taking in two errors and a status code. The reason being is if the error is a 
user error it returns it to the user in the response if it is a system error it 
just logs it as the user really doesn't need to know about it.
   
   In this case on the db errors you would return a sysErr and on missing 
capabilities you would return a usrErr.

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


With regards,
Apache Git Services

Reply via email to