Skip to content

Conversation

@LINKIWI
Copy link
Contributor

@LINKIWI LINKIWI commented May 16, 2025

The internal/pool package has some structured errors:

  • ErrClosed
  • ErrPoolExhausted
  • ErrPoolTimeout

These errors may be propagated to the callsites of top-level commands on the connection. Exposing these errors in the public package layer makes it much easier for external code to detect and classify these errors, e.g. as:

err := ...
if errors.Is(err, redis.ErrPoolTimeout) {
    ...
}

This change proposes re-exporting the remaining ErrPool* errors, adding to ErrClosed which is already re-exported.

See also: #3381

Copy link
Member

@ndyakov ndyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @LINKIWI thanks for the contribution

@ndyakov ndyakov merged commit ba26e35 into redis:master May 19, 2025
25 of 26 checks passed
ofekshenawa pushed a commit to ofekshenawa/go-redis that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants