Skip to content

Commit db20884

Browse files
authored
Provider did not catch 400 error returned from the API (#687)
Co-authored-by: admin <[email protected]>
1 parent 129e265 commit db20884

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mongodbatlas/resource_mongodbatlas_advanced_cluster.go

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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)