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:
parent
64948c3712
commit
49342ec140
1 changed files with 3 additions and 5 deletions
|
@ -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}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue