You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/02/08 03:00:21 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new issue #5503: Go client swallows alerts on error

ocket8888 opened a new issue #5503:
URL: https://github.com/apache/trafficcontrol/issues/5503


   ## I'm submitting a ...
   -  improvement request (usability, performance, tech debt, etc.)
   
   ## Traffic Control components affected ...
   -  Traffic Ops Client (Go)
   
   ## Current behavior:
   When the Traffic Ops API response to a request made by the Go client is >= 300 and != 304, the body of the response is read into the content of a returned error - and behind the scenes the body is also closed. This makes it difficult to write client methods that actually return error alerts, since the normally used methods employed by writers of a new client method will all exhibit this behavior.
   
   It's not that it's impossible, it's just not possible using the common `RawRequest`, `makeRequestWithHdr`, `post`/`put`/`get`/etc. methods.
   
   ## New behavior:
   The client should return an error like "Traffic Ops responded with 400 Bad Request" and leave the alerts to the actual returned Alerts.
   
   I'm not sure if this can actually be done in the APIv3- client(s), since the tests check for alert text in the errors, which might mean that it's expected behavior on which clients depend. But it can safely be done in the new APIv4 client, since nobody's using that.
   
   ## Minimal reproduction of the problem with instructions:
   Use a client method that results in an error, notice that no alerts are returned.


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



[GitHub] [trafficcontrol] ocket8888 commented on issue #5503: Go client swallows alerts on error

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #5503:
URL: https://github.com/apache/trafficcontrol/issues/5503#issuecomment-983932686


   This was fixed in #5747 


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 closed issue #5503: Go client swallows alerts on error

Posted by GitBox <gi...@apache.org>.
ocket8888 closed issue #5503:
URL: https://github.com/apache/trafficcontrol/issues/5503


   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org