mattjackson220 commented on a change in pull request #4470: Deprecate keys/ping
URL: https://github.com/apache/trafficcontrol/pull/4470#discussion_r390515085
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/ping/keys.go
 ##########
 @@ -20,25 +20,29 @@ package ping
  */
 
 import (
-       "errors"
+       "github.com/apache/trafficcontrol/lib/go-tc"
        "net/http"
 
        "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
        
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/riaksvc"
 )
 
 func Keys(w http.ResponseWriter, r *http.Request) {
+       alerts := tc.CreateAlerts(tc.WarnLevel, "This endpoint is deprecated")
        inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
        if userErr != nil || sysErr != nil {
-               api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+               userErr = api.LogErr(r, errCode, userErr, sysErr)
+               alerts.AddAlerts(tc.CreateErrorAlerts(userErr))
+               api.WriteAlerts(w, r, errCode, alerts)
 
 Review comment:
   so i added a HandleDeprecatedErr function in PR 4452 that will hopefully be 
merged in soon but id use that generic handler instead. i can see about getting 
it reviewed / merged otherwise you can just steal that code

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to