zrhoffman commented on a change in pull request #5003:
URL: https://github.com/apache/trafficcontrol/pull/5003#discussion_r485103816
##########
File path: traffic_ops/v3-client/server.go
##########
@@ -117,6 +117,9 @@ func (to *Session) CreateServer(server tc.ServerNullable)
(tc.Alerts, ReqInf, er
resp, remoteAddr, err := to.request(http.MethodPost, API_SERVERS,
reqBody, nil)
reqInf.RemoteAddr = remoteAddr
if err != nil {
+ if strings.Contains(err.Error(), "400 Bad Request[400]") {
+ reqInf.StatusCode = resp.StatusCode
+ }
Review comment:
Also `reqInf.StatusCode = resp.StatusCode` should be inside a `nil`
check for `resp`.
----------------------------------------------------------------
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]