Skip to content

Export connection pool errors for public consumption#3380

Merged
ndyakov merged 1 commit into
redis:masterfrom
LINKIWI:pool-errors-export
May 19, 2025
Merged

Export connection pool errors for public consumption#3380
ndyakov merged 1 commit into
redis:masterfrom
LINKIWI:pool-errors-export

Conversation

@LINKIWI

@LINKIWI LINKIWI commented May 16, 2025

Copy link
Copy Markdown
Contributor

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

@ndyakov ndyakov left a comment

Copy link
Copy Markdown
Member

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