Skip to content

Export connection pool errors for public consumption #3380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025

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
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