Skip to content

Commit

Permalink
Merge pull request #3024 from dperny/fix-agent-panic
Browse files Browse the repository at this point in the history
Fix panic in agent
  • Loading branch information
dperny committed Aug 30, 2021
2 parents 516e8f3 + 39a4233 commit 7956265
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions agent/exec/errors.go
Expand Up @@ -70,17 +70,14 @@ func (t temporary) Temporary() bool { return true }
// IsTemporary returns true if the error or a recursive cause returns true for
// temporary.
func IsTemporary(err error) bool {
for err != nil {
if tmp, ok := err.(Temporary); ok && tmp.Temporary() {
return true
}
if tmp, ok := err.(Temporary); ok && tmp.Temporary() {
return true
}

cause := errors.Cause(err)
if cause == err {
break
}
cause := errors.Cause(err)

err = cause
if tmp, ok := cause.(Temporary); ok && tmp.Temporary() {
return true
}

return false
Expand Down

0 comments on commit 7956265

Please sign in to comment.