coreos / fleet

fleet ties together systemd and etcd into a distributed init system
Apache License 2.0
2.42k stars 303 forks source link

*: avoid using err.Error() #1670

Closed dongsupark closed 7 years ago

dongsupark commented 7 years ago

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().

dongsupark commented 7 years ago

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