Skip to content

Commit 8302f27

Browse files
committed
Update usage.go
1 parent 763d55f commit 8302f27

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

premium/usage.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
awsConfig "github.com/aws/aws-sdk-go-v2/config"
1616
"github.com/aws/aws-sdk-go-v2/service/marketplacemetering"
1717
"github.com/aws/aws-sdk-go-v2/service/marketplacemetering/types"
18-
"github.com/aws/smithy-go"
1918
cqapi "github.com/cloudquery/cloudquery-api-go"
2019
"github.com/cloudquery/cloudquery-api-go/auth"
2120
"github.com/cloudquery/cloudquery-api-go/config"
@@ -316,11 +315,10 @@ func (u *BatchUpdater) setupAWSMarketplace() error {
316315
UsageQuantity: aws.Int32(int32(0)),
317316
DryRun: aws.Bool(true),
318317
})
319-
var apiErr smithy.APIError
320-
if errors.As(err, &apiErr) && apiErr.ErrorCode() == "DryRunOperation" {
321-
return nil
318+
if err != nil {
319+
return fmt.Errorf("failed dry run invocation with error: %w", err)
322320
}
323-
return fmt.Errorf("failed dry run invocation with error: %w", err)
321+
return nil
324322
}
325323

326324
func isAWSMarketplace() bool {

0 commit comments

Comments
 (0)