Skip to content

Commit

Permalink
internal/xerrors changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Sep 6, 2024
1 parent cd58c33 commit 5027ec6
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/xerrors/retryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,16 @@ type unretryableError struct {
func (e unretryableError) Unwrap() error {
return e.error
}

func IsRetryableError(err error) bool {
if err == nil {
return true
}

var e *retryableError
if errors.As(err, &e) {
return e != nil
}

return false
}
31 changes: 31 additions & 0 deletions trace/query_gtrace.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5027ec6

Please sign in to comment.