Skip to content

Commit

Permalink
add error return when category value cannot be created (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickstruyf3 authored Aug 28, 2023
1 parent c668afd commit 268fc9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ func getOrCreateCategory(ctx context.Context, client *nutanixClientV3.Client, ca
Value: utils.StringPtr(categoryIdentifier.Value),
})
if err != nil {
log.Error(err, fmt.Sprintf("failed to create category value %s in category key %s", categoryIdentifier.Value, categoryIdentifier.Key))
errorMsg := fmt.Errorf("failed to create category value %s in category key %s: %v", categoryIdentifier.Value, categoryIdentifier.Key, err)
log.Error(errorMsg, "failed to create category value")
return nil, errorMsg
}
}
return categoryValue, nil
Expand Down

0 comments on commit 268fc9a

Please sign in to comment.