Hi,
I've been hitting problems with some API calls to Hub timing out resulting in a panic due to an error being returned along with *http.Response being nil.
I've tweaked the hubclient locally (handled the nil in this single location and set a dial timeout) and was able to see that in my case the underlying error being thrown (resulting in resp == nil) was:
net/http: request canceled (Client.Timeout exceeded while awaiting headers)
The error handling should be tweaked to account for the possibility of resp being nil.
Hi, I've been hitting problems with some API calls to Hub timing out resulting in a panic due to an error being returned along with
*http.Response
beingnil
.resp
isnil
here with the panic inreadResponseBody
occurring when an attempt to accessresp.Body
is made:https://github.com/blackducksoftware/hub-client-go/blob/e27076af6370051227bbe0a09f2b3506e7126f32/hubclient/client.go#L174-L177
I've tweaked the
hubclient
locally (handled the nil in this single location and set a dial timeout) and was able to see that in my case the underlying error being thrown (resulting inresp == nil
) was:The error handling should be tweaked to account for the possibility of
resp
beingnil
.