Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: Fixed NotFound errors exceptions for some resources (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanenk authored May 31, 2022
1 parent 8d73ea6 commit d2cab56
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/services/apigateway/rest_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ func fetchApigatewayRestApiModels(ctx context.Context, meta schema.ClientMeta, p
options.Region = c.Region
})
if err != nil {
if c.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- response.Items
Expand Down
3 changes: 3 additions & 0 deletions resources/services/elbv2/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ func fetchElbv2Listeners(ctx context.Context, meta schema.ClientMeta, parent *sc
options.Region = c.Region
})
if err != nil {
if c.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- response.Listeners
Expand Down
3 changes: 3 additions & 0 deletions resources/services/kms/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func fetchKmsKeys(ctx context.Context, meta schema.ClientMeta, parent *schema.Re
options.Region = c.Region
})
if err != nil {
if c.IsNotFoundError(err) {
continue
}
return diag.WrapError(err)
}
if d.KeyMetadata != nil {
Expand Down
3 changes: 3 additions & 0 deletions resources/services/lambda/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,9 @@ func fetchLambdaFunctionVersions(ctx context.Context, meta schema.ClientMeta, pa
for {
output, err := svc.ListVersionsByFunction(ctx, &config)
if err != nil {
if meta.(*client.Client).IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- output.Versions
Expand Down
3 changes: 3 additions & 0 deletions resources/services/rds/cluster_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ func resolveRDSClusterSnapshotAttributes(ctx context.Context, meta schema.Client
},
)
if err != nil {
if c.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
if out.DBClusterSnapshotAttributesResult == nil {
Expand Down

0 comments on commit d2cab56

Please sign in to comment.