Deleting permament error as it doesn't make sense. Just return a plain old error and that will be considered permanent.

This commit is contained in:
Renan DelValle 2018-02-12 15:29:27 -08:00
parent 64948c3712
commit 49342ec140
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9

View file

@ -16,6 +16,8 @@ package realis
// Using a pattern described by Dave Cheney to differentiate errors
// https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
// Timeout errors are returned when a function has unsuccessfully retried.
type timeout interface {
Timeout() bool
}
@ -38,6 +40,7 @@ func NewTimeoutError(err error) *TimeoutErr {
return &TimeoutErr{error: err, timeout: true}
}
// Temporary errors indicate that the action may and should be retried.
type temporary interface {
Temporary() bool
}
@ -60,8 +63,3 @@ func (t *TemporaryErr) Temporary() bool {
func NewTemporaryError(err error) *TemporaryErr {
return &TemporaryErr{error: err, temporary: true}
}
// Nothing can be done about this error
func NewPermamentError(err error) TemporaryErr {
return TemporaryErr{error: err, temporary: false}
}