File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ func (c *Client) sendRequest(request *request) (*http.Response, error) {
202202 resp , respErr := c .httpClient .Do (req )
203203
204204 // check if context deadline exceeded
205- if respErr != nil && strings .Contains (respErr .Error (), "context deadline exceeded" ) || http .StatusRequestTimeout == resp .StatusCode {
205+ if respErr != nil && strings .Contains (respErr .Error (), "context deadline exceeded" ) || ( resp != nil && http .StatusRequestTimeout == resp .StatusCode ) {
206206 // retry until max retries reached
207207 sleepDuration := time .Duration (1 ) * time .Second
208208 for i := 0 ; i < MAX_CONTEXT_DEADLINE_RETRIES ; i ++ {
@@ -226,6 +226,10 @@ func (c *Client) sendRequest(request *request) (*http.Response, error) {
226226 resp = resp2
227227 break
228228 }
229+ respErr = respErr2
230+ }
231+ if resp == nil {
232+ return nil , fmt .Errorf ("no response from Keyfactor Command after %d retries" , MAX_CONTEXT_DEADLINE_RETRIES )
229233 }
230234 } else if respErr != nil {
231235 return nil , respErr
You can’t perform that action at this time.
0 commit comments