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

Bugfix/nil exc check fails #268

Merged
merged 2 commits into from
Jul 23, 2022
Merged

Bugfix/nil exc check fails #268

merged 2 commits into from
Jul 23, 2022

Conversation

lthibault
Copy link
Collaborator

Fixes two error-handling bugs that were generating false positives. The first is a classic "gotcha" of using fmt.Errorf's %w directive; wrapping a nil error in this way will produce a non-nil error. The second is a classic "gotcha" regarding interfaces; passing a nil *Exception as as a parameter of type error produces a non-nil error interface.

@lthibault lthibault added the bug label Jul 22, 2022
@lthibault lthibault requested a review from zenhack July 22, 2022 18:36
@lthibault lthibault marked this pull request as ready for review July 22, 2022 18:36
@zenhack zenhack merged commit 13980e3 into main Jul 23, 2022
@zenhack
Copy link
Contributor

zenhack commented Jul 23, 2022

Just curious: were you observing the effects of this somewhere, or did you just spot it in the code while working on something else?

@lthibault
Copy link
Collaborator Author

@zenhack Sorry for the late response (was traveling). I observed this while trying to run BenchmarkPingPong. The ErrorReporter was incorrectly flagging a bunch of nil errors/exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants