hailocab/gossie — pull request #12 by mattheath (2014-07-21 16:01:15+00:00)
Title: Pass back nonrecoverable auth errors when acquiring a connection

When using a cassandra cluster with _authentication_ turned on, acquiring a `newConnection` can return an authentication or authorization error. Unfortunately the `runWithRetries` method continues on errors from `acquire` which makes sense in the case of a timeout, or other transient error, but not in the case of an authentication error, and the error returned in this case will always be `ErrorMaxRetriesReached`.

This updates the `runWithRetries` (and by extension `run`) method on a `ConnectionPool` to return the `ErrorAuthenticationFailed` or `ErrorAuthorizationFailed` errors if encountered, which will then be passed back through the `NewConnectionPool` constructor on failure.