Skip to content

Commit

Permalink
Fix: plugin v1.4.14 crashes (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Aug 21, 2023
1 parent 6d46781 commit 2dae0e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions env0/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ func configureProvider(version string, p *schema.Provider) schema.ConfigureConte
SetRetryWaitTime(time.Second).
SetRetryMaxWaitTime(time.Second * 5).
OnBeforeRequest(func(c *resty.Client, r *resty.Request) error {
tflog.SubsystemInfo(subCtx, "env0_api_client", "Sending request", map[string]interface{}{"method": r.Method, "url": r.URL})
if r != nil {
tflog.SubsystemInfo(subCtx, "env0_api_client", "Sending request", map[string]interface{}{"method": r.Method, "url": r.URL})
}
return nil
}).
OnAfterResponse(func(c *resty.Client, r *resty.Response) error {
Expand All @@ -173,7 +175,7 @@ func configureProvider(version string, p *schema.Provider) schema.ConfigureConte
AddRetryCondition(func(r *resty.Response, err error) bool {
if r == nil {
// No response. Possiblly a networking issue (E.g. DNS lookup failure).
tflog.SubsystemWarn(subCtx, "env0_api_client", "No response, retrying request", map[string]interface{}{"method": r.Request.Method, "url": r.Request.URL})
tflog.SubsystemWarn(subCtx, "env0_api_client", "No response, retrying request")
return true
}

Expand Down

0 comments on commit 2dae0e8

Please sign in to comment.