Addressing feedback. Monitors now return errors which provide context through behavior. Adding notes to the doc explaining what happens when AbortJob times out.

This commit is contained in:
Renan DelValle 2019-01-14 15:32:47 -08:00
parent e90eeaf2b4
commit 6183c5a375
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3 changed files with 29 additions and 31 deletions

View file

@ -28,6 +28,19 @@ func IsTimeout(err error) bool {
return ok && temp.Timedout()
}
type timeoutErr struct {
error
timedout bool
}
func (r *timeoutErr) Timedout() bool {
return r.timedout
}
func newTimedoutError(err error) *timeoutErr {
return &timeoutErr{error: err, timedout: true}
}
// retryErr is a superset of timeout which includes extra context
// with regards to our retry mechanism. This is done in order to make sure
// that our retry mechanism works as expected through our tests and should