In my go application I am getting the following error: "http: server closed idle connection". I would like to catch it and retry my http connection if it's encountered.
I found that this error comes from the "net/http" package and furthermore from the transport implementation. In particular it's defined here
I get it wrapped in url.Error but this is all I was able to find out. Do you know how I can actually catch this error?
Edit:
I am using elastic search client, which in turn is using the net/http. From the client I get the above mentioned error and would like to retry my elastic search request as being transient. For now the way I am catching transient errors is:
if urlErr, ok := err.(*url.Error); ok && (urlErr.Temporary() || urlErr.Err == io.EOF) {
return retryRequest()
}
error values for debugging and testing, not seen by users.