Skip to content

Commit cb99f38

Browse files
authored
fix(cloudauth): remove 404 error swallow (#533)
These errors should not be swallowed. they are legitimate and should be bubbled up. Leaving the 404 swallow for the delete case since it also represents success on a delete operation
1 parent 1be676c commit cb99f38

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

sysdig/resource_sysdig_secure_cloud_auth_account.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, data *schema.
216216

217217
cloudauthAccount, errStatus, err := client.GetCloudauthAccountSecure(ctx, data.Id())
218218
if err != nil {
219-
if strings.Contains(errStatus, "404") {
220-
return nil
221-
}
222219
return diag.Errorf("Error reading resource: %s %s", errStatus, err)
223220
}
224221

@@ -238,9 +235,6 @@ func resourceSysdigSecureCloudauthAccountUpdate(ctx context.Context, data *schem
238235

239236
existingCloudAccount, errStatus, err := client.GetCloudauthAccountSecure(ctx, data.Id())
240237
if err != nil {
241-
if strings.Contains(errStatus, "404") {
242-
return nil
243-
}
244238
return diag.Errorf("Error reading resource: %s %s", errStatus, err)
245239
}
246240

@@ -254,9 +248,6 @@ func resourceSysdigSecureCloudauthAccountUpdate(ctx context.Context, data *schem
254248

255249
_, errStatus, err = client.UpdateCloudauthAccountSecure(ctx, data.Id(), newCloudAccount)
256250
if err != nil {
257-
if strings.Contains(errStatus, "404") {
258-
return nil
259-
}
260251
return diag.Errorf("Error updating resource: %s %s", errStatus, err)
261252
}
262253

0 commit comments

Comments
 (0)