From 711522ead844b275247f6265aa0f4fb20548d8e1 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Fri, 11 Feb 2022 14:57:26 +1100 Subject: [PATCH] nest err check inside to prevent failures --- .../resource_cloudflare_custom_hostname_fallback_origin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cloudflare/resource_cloudflare_custom_hostname_fallback_origin.go b/cloudflare/resource_cloudflare_custom_hostname_fallback_origin.go index 9742222afa..89a014106d 100644 --- a/cloudflare/resource_cloudflare_custom_hostname_fallback_origin.go +++ b/cloudflare/resource_cloudflare_custom_hostname_fallback_origin.go @@ -64,8 +64,10 @@ func resourceCloudflareCustomHostnameFallbackOriginCreate(d *schema.ResourceData return resource.Retry(d.Timeout(schema.TimeoutDefault), func() *resource.RetryError { _, err := client.UpdateCustomHostnameFallbackOrigin(context.Background(), zoneID, fallbackOrigin) if err != nil { - if errors.As(err, &cloudflare.APIRequestError{}) && err.(*cloudflare.APIRequestError).InternalErrorCodeIs(1414) { - return resource.RetryableError(fmt.Errorf("expected custom hostname resource to be ready for modification but is still pending")) + if errors.As(err, &cloudflare.APIRequestError{}) { + if err.(*cloudflare.APIRequestError).InternalErrorCodeIs(1414) { + return resource.RetryableError(fmt.Errorf("expected custom hostname resource to be ready for modification but is still pending")) + } } else { return resource.NonRetryableError(errors.Wrap(err, "failed to create custom hostname fallback origin")) }