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

Intelligent errors.Cause() #1

Closed
wants to merge 1 commit into from
Closed

Intelligent errors.Cause() #1

wants to merge 1 commit into from

Conversation

jaekwon
Copy link
Owner

@jaekwon jaekwon commented Dec 21, 2017

When causer.Cause() returns nil or itself, it is the cause.

Ref: pkg#89

errors.go Outdated
}
err = cause.Cause()

Choose a reason for hiding this comment

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

If you never update err, then this for loop can never finish, and it is now possible that the loop becomes a forever loop.

Copy link
Owner Author

Choose a reason for hiding this comment

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

heh, was just about to test. thank you.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done.

When causer.Cause() returns nil or itself, it is the cause.
@jaekwon
Copy link
Owner Author

jaekwon commented Dec 21, 2017

Closing this to open a PR on pkg/errors

@jaekwon jaekwon closed this Dec 21, 2017
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