Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 3fbb1e7

Browse files
martinstibbeguineveresaenger
authored andcommitted
Provider did not catch 400 error returned from the API (mongodb#687)
Co-authored-by: admin <[email protected]>
1 parent e22c424 commit 3fbb1e7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mongodbatlas/resource_mongodbatlas_advanced_cluster.go

+3
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ func resourceMongoDBAtlasAdvancedClusterUpdate(ctx context.Context, d *schema.Re
583583
return resource.NonRetryableError(fmt.Errorf(errorClusterAdvancedUpdate, clusterName, err))
584584
}
585585
}
586+
if errors.As(err, &target) && target.HTTPCode == 400 {
587+
return resource.NonRetryableError(fmt.Errorf(errorClusterAdvancedUpdate, clusterName, err))
588+
}
586589
}
587590
return nil
588591
})

mongodbatlas/resource_mongodbatlas_cluster.go

+3
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,9 @@ func resourceMongoDBAtlasClusterUpdate(ctx context.Context, d *schema.ResourceDa
915915
return resource.NonRetryableError(fmt.Errorf(errorClusterUpdate, clusterName, err))
916916
}
917917
}
918+
if errors.As(err, &target) && target.HTTPCode == 400 {
919+
return resource.NonRetryableError(fmt.Errorf(errorClusterUpdate, clusterName, err))
920+
}
918921
}
919922
return nil
920923
})

0 commit comments

Comments
 (0)