handle errors properly

When an err is returned such as as unreachable host (etcd is down), the resp
object will be null.