Skip to content

Commit

Permalink
Check for errors while setting complex types
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoreni committed Sep 28, 2018
1 parent 0b9d8ff commit 1ea7cda
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions aws/resource_aws_pinpoint_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,15 @@ func resourceAwsPinpointAppRead(d *schema.ResourceData, meta interface{}) error
d.Set("name", app.ApplicationResponse.Name)
d.Set("application_id", app.ApplicationResponse.Id)

d.Set("campaign_hook", flattenPinpointCampaignHook(settings.ApplicationSettingsResource.CampaignHook))
d.Set("limits", flattenPinpointCampaignLimits(settings.ApplicationSettingsResource.Limits))
d.Set("quiet_time", flattenPinpointQuietTime(settings.ApplicationSettingsResource.QuietTime))
if err := d.Set("campaign_hook", flattenPinpointCampaignHook(settings.ApplicationSettingsResource.CampaignHook)); err != nil {
return fmt.Errorf("error setting campaign_hook: %s", err)
}
if err := d.Set("limits", flattenPinpointCampaignLimits(settings.ApplicationSettingsResource.Limits)); err != nil {
return fmt.Errorf("error setting limits: %s", err)
}
if err := d.Set("quiet_time", flattenPinpointQuietTime(settings.ApplicationSettingsResource.QuietTime)); err != nil {
return fmt.Errorf("error setting quiet_time: %s", err)
}

return nil
}
Expand Down

0 comments on commit 1ea7cda

Please sign in to comment.