Skip to content

Commit

Permalink
fix: error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
parthpnx committed Oct 24, 2024
1 parent 6cd24fc commit aacc93f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/provider/log_group/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ func Create(d *schema.ResourceData, m interface{}) error {
c := cloudwatchlogs.NewFromConfig(cfg)

var (
name = d.Get(Name).(string)
ctx = context.TODO()
name = d.Get(Name).(string)
ctx = context.TODO()
exception *types.ResourceAlreadyExistsException
)

_, err := c.CreateLogGroup(context.TODO(), &cloudwatchlogs.CreateLogGroupInput{
LogGroupName: aws.String(name),
})

var exception *types.ResourceAlreadyExistsException
if !errors.As(err, &exception) {
if !errors.As(err, &exception) && err != nil {
return err
}

Expand Down

0 comments on commit aacc93f

Please sign in to comment.