Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

*: avoid using err.Error() #1670

Merged
merged 3 commits into from
Aug 30, 2016

Conversation

dongsupark
Copy link
Contributor

In principle we should avoid returning err.Error(). Instead we should just return err, to be able to inspect the error in a flexible way.

Also in rpcRenewLeadership() check for an exact error code from etcd, EcodeKeyNotFound, instead of comparing error string with a particular string pattern. Doing that, we can also avoid using err.Error().

Dongsu Park added 2 commits August 24, 2016 12:06
In principle we should avoid returning err.Error(). Instead we should
just return err, to be able to inspect the error in a flexible way.
rpcRenewLeadership() should check for an exact error code from etcd,
EcodeKeyNotFound, instead of comparing error string with a particular
string pattern. Doing that, we can also avoid using err.Error().
Add github.com/coreos/etcd/error for dependencies.
@dongsupark
Copy link
Contributor Author

Will merge this PR tomorrow, in case of no objection.

@dongsupark dongsupark merged commit 890c578 into coreos:master Aug 30, 2016
@dongsupark dongsupark deleted the dongsu/cleanup-error-method branch August 30, 2016 10:50
dongsupark pushed a commit that referenced this pull request Aug 30, 2016
dongsupark pushed a commit that referenced this pull request Aug 30, 2016
dongsupark pushed a commit that referenced this pull request Aug 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant