Documentation ¶
Overview ¶
Package fserrors provides errors and error handling
Index ¶
- func Cause(cause error) (retriable bool, err error)
- func FatalError(err error) error
- func IsFatalError(err error) bool
- func IsNoRetryError(err error) bool
- func IsRetryError(err error) bool
- func NoRetryError(err error) error
- func RetryError(err error) error
- func RetryErrorf(format string, a ...interface{}) error
- func ShouldRetry(err error) bool
- func ShouldRetryHTTP(resp *http.Response, retryErrorCodes []int) bool
- type Fataler
- type NoRetrier
- type Retrier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause is a souped up errors.Cause which can unwrap some standard library errors too. It returns true if any of the intermediate errors had a Timeout() or Temporary() method which returned true.
func FatalError ¶
FatalError makes an error which indicates it is a fatal error and the sync should stop.
func IsFatalError ¶
IsFatalError returns true if err conforms to the Fatal interface and calling the Fatal method returns true.
func IsNoRetryError ¶
IsNoRetryError returns true if err conforms to the NoRetry interface and calling the NoRetry method returns true.
func IsRetryError ¶
IsRetryError returns true if err conforms to the Retry interface and calling the Retry method returns true.
func NoRetryError ¶
NoRetryError makes an error which indicates the sync shouldn't be retried.
func RetryError ¶
RetryError makes an error which indicates it would like to be retried
func RetryErrorf ¶
RetryErrorf makes an error which indicates it would like to be retried
func ShouldRetry ¶
ShouldRetry looks at an error and tries to work out if retrying the operation that caused it would be a good idea. It returns true if the error implements Timeout() or Temporary() or if the error indicates a premature closing of the connection.
Types ¶
type Fataler ¶
Fataler is an optional interface for error as to whether the operation should cause the entire operation to finish immediately.
This should be returned from Update or Put methods as required