Skip to content
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

fix: wrap errors using %w to preserve context #1321

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

reugn
Copy link
Contributor

@reugn reugn commented Dec 17, 2024

Motivation

This pull request wraps errors using %w to preserve the original error and provide more meaningful error messages.

Modifications

  • Wrap errors using %w to preserve context
  • Handle errors using errors.Is()
  • Remove unreachable code
  • Fix typos

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)

Copy link
Member

@RobertIndie RobertIndie left a comment

Choose a reason for hiding this comment

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

Overall looks good to me! Left one comment.

pulsar/consumer_partition.go Show resolved Hide resolved
Copy link
Member

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

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

LGTM

@crossoverJie crossoverJie added this to the v0.15.0 milestone Dec 19, 2024
@crossoverJie crossoverJie merged commit 024e230 into apache:master Dec 19, 2024
7 checks passed
@reugn reugn deleted the wrap-errors branch December 24, 2024 08:44
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.

3 participants