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

Add errors.Cause to find inital cause of error. #1453

Merged
merged 1 commit into from
May 9, 2019

Conversation

jrick
Copy link
Member

@jrick jrick commented May 8, 2019

This will simplify situations where calling code must unwrap the error chain for
other errors and error types.

@jrick
Copy link
Member Author

jrick commented May 9, 2019

This will require some extra changes or additional documentation to cover this corner case:

errors.Cause(errors.E("error")) // type is errors.errorString from the stdlib

This is due to how E uses stdlib errors.New is used to create errors from strings.

This will simplify situations where calling code must unwrap the error chain for
other errors and error types.
@jrick jrick merged commit 45264e7 into decred:master May 9, 2019
@jrick jrick deleted the errorcause branch May 9, 2019 16:37
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