Skip to content

Commit

Permalink
No need for extra error wrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed May 26, 2022
1 parent 883440c commit e4eb848
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/service/kafka/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -719,7 +719,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -749,7 +749,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand All @@ -776,7 +776,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -811,7 +811,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -841,7 +841,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -874,7 +874,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -918,7 +918,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int

// refresh the current_version attribute after each update
if err := refreshClusterVersion(ctx, d, meta); err != nil {
return diag.Errorf("error refreshing current_version attribute for MSK Cluster (%s): %s ", d.Id(), err)
return diag.FromErr(err)
}
}

Expand Down Expand Up @@ -1747,7 +1747,7 @@ func refreshClusterVersion(ctx context.Context, d *schema.ResourceData, meta int
cluster, err := FindClusterByARN(ctx, conn, d.Id())

if err != nil {
return fmt.Errorf("reading MSK Cluster (%s): %s", d.Id(), err)
return fmt.Errorf("reading MSK Cluster (%s): %w", d.Id(), err)
}

d.Set("current_version", cluster.CurrentVersion)
Expand Down

0 comments on commit e4eb848

Please sign in to comment.