Skip to content

Commit

Permalink
data.azurerm_monitor_data_collection_rule - raises an error when th…
Browse files Browse the repository at this point in the history
…e specified data collection rule can't be found (#20282)
  • Loading branch information
tombuildsstuff authored Feb 3, 2023
1 parent 4ce0783 commit 97571f8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ func (d DataCollectionRuleDataSource) Read() sdk.ResourceFunc {
resp, err := client.Get(ctx, id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
metadata.Logger.Infof("%s was not found - removing from state!", id)
return metadata.MarkAsGone(id)
return fmt.Errorf("%s was not found", id)
}
return fmt.Errorf("retrieving %s: %+v", id, err)
}
Expand Down

0 comments on commit 97571f8

Please sign in to comment.