Skip to content

Commit ce191c1

Browse files
author
mikatong
committed
update
1 parent ef94494 commit ce191c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tencentcloud/services/cvm/resource_tc_instance.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,10 @@ func resourceTencentCloudInstanceCreate(d *schema.ResourceData, meta interface{}
697697
}
698698
if instance != nil && *instance.InstanceState == CVM_STATUS_LAUNCH_FAILED {
699699
//LatestOperationCodeMode
700-
return resource.NonRetryableError(fmt.Errorf("cvm instance %s launch failed. Error msg: %s.\n", *instance.InstanceId, *instance.LatestOperationErrorMsg))
700+
if instance.LatestOperationErrorMsg != nil {
701+
return resource.NonRetryableError(fmt.Errorf("cvm instance %s launch failed. Error msg: %s.\n", *instance.InstanceId, *instance.LatestOperationErrorMsg))
702+
}
703+
return resource.NonRetryableError(fmt.Errorf("cvm instance %s launch failed, this resource will not be stored to tfstate and will auto removed\n.", *instance.InstanceId))
701704
}
702705
if instance != nil && *instance.InstanceState == CVM_STATUS_RUNNING {
703706
return nil

0 commit comments

Comments
 (0)