Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenEarth committed Dec 24, 2024
1 parent 9112889 commit 890b6fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ func resourceTencentCloudClbListenerDefaultDomainCreate(d *schema.ResourceData,
}

if result == nil || result.Response == nil || response.Response.RequestId == nil {
e = fmt.Errorf("modify domain failed")
return resource.NonRetryableError(e)
return resource.NonRetryableError(fmt.Errorf("modify domain attributes failed"))
}

response = result
Expand Down Expand Up @@ -231,8 +230,7 @@ func resourceTencentCloudClbListenerDefaultDomainUpdate(d *schema.ResourceData,
}

if result == nil || result.Response == nil || response.Response.RequestId == nil {
e = fmt.Errorf("modify domain failed")
return resource.NonRetryableError(e)
return resource.NonRetryableError(fmt.Errorf("modify domain attributes failed"))
}

response = result
Expand Down
20 changes: 20 additions & 0 deletions tencentcloud/services/clb/resource_tc_clb_listener_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil || response.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("create CLB listener rule failed"))
}

requestId = *response.Response.RequestId
retryErr := waitForTaskFinish(requestId, meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient())
if retryErr != nil {
Expand Down Expand Up @@ -401,6 +405,10 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil || response.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("modify domain attributes failed"))
}

requestId := *response.Response.RequestId
retryErr := waitForTaskFinish(requestId, meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient())
if retryErr != nil {
Expand Down Expand Up @@ -435,6 +443,10 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil || response.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("modify rule failed"))
}

requestId := *response.Response.RequestId
retryErr := waitForTaskFinish(requestId, meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient())
if retryErr != nil {
Expand Down Expand Up @@ -681,6 +693,10 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil || response.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("modify rule failed"))
}

requestId := *response.Response.RequestId
retryErr := waitForTaskFinish(requestId, meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient())
if retryErr != nil {
Expand Down Expand Up @@ -751,6 +767,10 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil || response.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("modify domain attributes failed"))
}

requestId := *response.Response.RequestId
retryErr := waitForTaskFinish(requestId, meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient())
if retryErr != nil {
Expand Down

0 comments on commit 890b6fc

Please sign in to comment.