gocql/gocql — pull request #153 by mihasya (2014-04-23 23:21:51+00:00)
Title: provide some details when encountering a protocol error

Hey guys, this is a first cut at an implementation of more verbose messaging for protocol errors. The motivation is that we occasionally see `protocol error` in our logs, but have no further recourse for figuring out what was even happening.

This preserves the ability to broadly distinguish protocol errors from others (by doing `err.(ProtocolError)`) while also permitting more verbose logging. Functionally, this patch should be identical, though I would appreciate a good vetting to ensure the messages actually communicate the error correctly.

I would also love to see the same approach adopted to other errors that appear frequently in the code, but I haven't grepped to see if there are others yet and thought I'd cut this PR to see what everyone thought of the general idea.

The tests pass against cassandra 1.2 with `-proto=1`.