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:
commit
8fd8f4657a
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue