Skip to content

Commit

Permalink
Hide errors from FilesEntity.Apply to match upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Shumaker committed Jan 11, 2017
1 parent 5f09f50 commit 4bf39f9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/holocm.org/plugins/files/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,26 @@ func (target *FilesEntity) EntityUserInfo() (r []holo.KV) {
}

func (target *FilesEntity) Apply(withForce bool, stdout, stderr io.Writer) holo.ApplyResult {
// BUG(lukeshu): FilesEntity.Apply: We hide errors here to
// match the upstream behavior of holo-files:
// https://github.com/holocm/holo/issues/19
if target.orphaned {
errs := target.handleOrphanedTargetBase()
if len(errs) > 0 {
for _, err := range errs {
fmt.Fprintf(stderr, "!! %s\n", err.Error())
}
return holo.NewApplyError(errs[0])
//return holo.NewApplyError(errs[0])
return holo.ApplyApplied
}
return holo.ApplyApplied
} else {
result, err := target.apply(withForce)

if err != nil {
fmt.Fprintf(stderr, "!! %s\n", err.Error())
return holo.NewApplyError(err)
//return holo.NewApplyError(err)
return holo.ApplyApplied
}

return result
Expand Down

0 comments on commit 4bf39f9

Please sign in to comment.