Skip to content

Commit

Permalink
Merge pull request hashicorp#5634 from TimeIncOSS/f-resource-not-foun…
Browse files Browse the repository at this point in the history
…d-err

helper/resource: Add more details (Retries) to resource.NotFoundError
  • Loading branch information
jen20 authored Jan 23, 2017
2 parents 4fcc301 + 6222b3e commit 8fd8f46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helper/resource/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func (e *NotFoundError) Error() string {
return e.Message
}

if e.Retries > 0 {
return fmt.Sprintf("couldn't find resource (%d retries)", e.Retries)
}

return "couldn't find resource"
}

Expand Down
1 change: 1 addition & 0 deletions helper/resource/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) {
if notfoundTick > conf.NotFoundChecks {
result.Error = &NotFoundError{
LastError: err,
Retries: notfoundTick,
}
lastResult.Store(result)
return
Expand Down

0 comments on commit 8fd8f46

Please sign in to comment.