Skip to content

Commit 6032db5

Browse files
committed
add comments
1 parent 88e70f9 commit 6032db5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

error.go

+5
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,27 @@ func Permanent(err error) error {
2020
}
2121
}
2222

23+
// Error returns a string representation of the Permanent error.
2324
func (e *PermanentError) Error() string {
2425
return e.Err.Error()
2526
}
2627

28+
// Unwrap returns the wrapped error.
2729
func (e *PermanentError) Unwrap() error {
2830
return e.Err
2931
}
3032

33+
// RetryAfterError signals that the operation should be retried after the given duration.
3134
type RetryAfterError struct {
3235
Duration time.Duration
3336
}
3437

38+
// RetryAfter returns a RetryAfter error that specifies how long to wait before retrying.
3539
func RetryAfter(seconds int) error {
3640
return &RetryAfterError{Duration: time.Duration(seconds) * time.Second}
3741
}
3842

43+
// Error returns a string representation of the RetryAfter error.
3944
func (e *RetryAfterError) Error() string {
4045
return fmt.Sprintf("retry after %s", e.Duration)
4146
}

0 commit comments

Comments
 (0)