diff --git a/errors.go b/errors.go index 2e94ff4..242176e 100644 --- a/errors.go +++ b/errors.go @@ -32,12 +32,12 @@ type TimeoutErr struct { timeout bool } -func (t TimeoutErr) Timeout() bool { +func (t *TimeoutErr) Timeout() bool { return t.timeout } -func NewTimeoutError(err error) TimeoutErr { - return TimeoutErr{error: err, timeout: true} +func NewTimeoutError(err error) *TimeoutErr { + return &TimeoutErr{error: err, timeout: true} } type temporary interface { @@ -54,13 +54,13 @@ type TemporaryErr struct { temporary bool } -func (t TemporaryErr) Temporary() bool { +func (t *TemporaryErr) Temporary() bool { return t.temporary } // Retrying after receiving this error is advised -func NewTemporaryError(err error) TemporaryErr { - return TemporaryErr{error: err, temporary: true} +func NewTemporaryError(err error) *TemporaryErr { + return &TemporaryErr{error: err, temporary: true} } // Nothing can be done about this error diff --git a/retry.go b/retry.go index d4cdc15..72c1cd1 100644 --- a/retry.go +++ b/retry.go @@ -83,7 +83,7 @@ func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error { func CheckAndRetryConn(r Realis, auroraCall AuroraThriftCall) (*aurora.Response, error) { resp, cliErr := auroraCall() - // TODO: Rerturn different error type based on the error that was returned by the API call + // TODO: Return different error type based on the error that was returned by the API call if cliErr != nil { r.ReestablishConn() return resp, NewPermamentError(RetryConnErr)