Reliably test for connection establishment error

35 views
Skip to first unread message

Marco Jantke

unread,
Feb 20, 2018, 8:15:55 AM2/20/18
to golang-nuts
I need to do retries for HTTP requests when the connection can't be established initially. As soon as there was a successful connection no retry should happen anymore. While there is error as return from the http.RoundTripper I'm not sure how I can accomplish to find out whether a connection was established already or not. One example is that we use the `ResponseHeaderTimeout` setting on the Transport and when this expires, we get an error as return value but we shouldn't retry. Anyone has an idea how to accomplish that?

Many thanks in advance! :-)
Reply all
Reply to author
Forward
0 new messages