Merge pull request #5634 from TimeIncOSS/f-resource-not-found-err

helper/resource: Add more details (Retries) to resource.NotFoundError
This commit is contained in:
James Nugent 2017-01-23 14:58:40 +00:00 committed by GitHub
commit 8fd8f4657a
2 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,10 @@ func (e *NotFoundError) Error() string {
return e.Message return e.Message
} }
if e.Retries > 0 {
return fmt.Sprintf("couldn't find resource (%d retries)", e.Retries)
}
return "couldn't find resource" return "couldn't find resource"
} }

View File

@ -111,6 +111,7 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) {
if notfoundTick > conf.NotFoundChecks { if notfoundTick > conf.NotFoundChecks {
result.Error = &NotFoundError{ result.Error = &NotFoundError{
LastError: err, LastError: err,
Retries: notfoundTick,
} }
lastResult.Store(result) lastResult.Store(result)
return return