AdoHe/etcd4j — pull request #3 by rouzwawi (2014-10-12 22:43:59+00:00)
Title: [rfc] Throw

Testing out how it would look to throw exceptions for all situations where one would get information from the errorCode/cause/message responses.

Basically there seems to be 3 ways something can go.

1. Success and a `EtcdResponse` is returned
2. Unexpected response (not found, precondition failed, etc) and an `EtcdClientException` is thrown with a contained `EtcdErrorResponse`
3. Something else goes wrong (not connected, server error response, etc) and an `EtcdClientException` is thrown with information about the http error

Even though both 2 and 3 are exceptional cases, 2 are maybe more thing where the application code might want to retry or take some action immediately. While 3 is things that might bubble up to higher levels of the application logic.

Not sure what is the best thing to do here yet. I'll research some etcd clients in other languages to see what the common pattern is.