Skip to content

Commit

Permalink
Return errors when setter fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanevet committed Mar 5, 2018
1 parent 4bd0ad1 commit 6012357
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pass/data_source_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ func passwordDataSourceRead(d *schema.ResourceData, meta interface{}) error {

d.SetId(path)

d.Set("password", sec.Password())
d.Set("data", sec.Data())
d.Set("body", sec.Body())
if err := d.Set("password", sec.Password()); err != nil {
log.Printf("[ERROR] Error when setting password: %v", err)
return err
}
if err := d.Set("data", sec.Data()); err != nil {
log.Printf("[ERROR] Error when setting data: %v", err)
return err
}
if err := d.Set("body", sec.Body()); err != nil {
log.Printf("[ERROR] Error when setting body: %v", err)
return err
}

return nil
}

0 comments on commit 6012357

Please sign in to comment.