File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -20,22 +20,27 @@ func Permanent(err error) error {
20
20
}
21
21
}
22
22
23
+ // Error returns a string representation of the Permanent error.
23
24
func (e * PermanentError ) Error () string {
24
25
return e .Err .Error ()
25
26
}
26
27
28
+ // Unwrap returns the wrapped error.
27
29
func (e * PermanentError ) Unwrap () error {
28
30
return e .Err
29
31
}
30
32
33
+ // RetryAfterError signals that the operation should be retried after the given duration.
31
34
type RetryAfterError struct {
32
35
Duration time.Duration
33
36
}
34
37
38
+ // RetryAfter returns a RetryAfter error that specifies how long to wait before retrying.
35
39
func RetryAfter (seconds int ) error {
36
40
return & RetryAfterError {Duration : time .Duration (seconds ) * time .Second }
37
41
}
38
42
43
+ // Error returns a string representation of the RetryAfter error.
39
44
func (e * RetryAfterError ) Error () string {
40
45
return fmt .Sprintf ("retry after %s" , e .Duration )
41
46
}
You can’t perform that action at this time.
0 commit comments