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

Wrap errors with additional information #321

Merged
merged 6 commits into from
Nov 10, 2023

Conversation

endorama
Copy link
Member

@endorama endorama commented Nov 9, 2023

apm-queue is a library, which leads to these errors surfacing in other code.

Debugging errors from libraries is painful without clear indication of where the error comes from.

To help with debugging this PR wrap errors with additional details.

One change that affects an err variable but is not an addition is the removal of a return err in pubsublite/topiccreator.go. The function handles the case err != nil separately so the only case in which that return err was executed was on err = nil. To increase clarity I changed it to directly return nil.

The code implicitly returns this occurrence of err only if err = nil.
Change it to nil instead to reduce confusion.
Copy link

github-actions bot commented Nov 9, 2023

⚠️ Warning

System-tests will not be executed for this PR because it is from a forked repository.
But it will still create a successful run-system-tests status check.

@endorama endorama enabled auto-merge (squash) November 10, 2023 09:06
@endorama endorama merged commit 76d0b0e into elastic:main Nov 10, 2023
3 checks passed
@endorama endorama deleted the improve-errors branch November 10, 2023 16:27
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