Skip to content

Commit

Permalink
Update retry.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
shogo82148 and coderabbitai[bot] authored Jun 18, 2024
1 parent a9c39c4 commit 0618fb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ func (e *temporaryError) Unwrap() error {
return e.error
}

// MarkTemporary marks err as a temporary error.
// It returns the error that implements interface{ Temporary() bool } and Temporary() returns true.
// MarkTemporary wraps an error as a temporary error, allowing retry mechanisms to handle it appropriately.
// This is especially useful in scenarios where errors may not require immediate termination of a process,
// but rather can be resolved through retrying operations.
func MarkTemporary(err error) error {
return &temporaryError{err}
}
Expand Down

0 comments on commit 0618fb5

Please sign in to comment.