Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
added cqlVersion check to mitigate cryptic 'cannot parse as hex bytes…
Browse files Browse the repository at this point in the history
…' errors
  • Loading branch information
tristanls committed Jun 18, 2013
1 parent 9d13345 commit 4ec3a8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ Connection.prototype.cql = function(cmd, args, options, callback){
callback = NOOP;
}

//verify that cqlVersion was set to prevent cryptic "cannot parse as hex bytes" errors
if (!this.cqlVersion) return callback(new Error("'cqlVersion' is not set; " +
"you have to set it explicitly as part of options when creating the " +
"connection pool (for example):" +
"var pool = new helenus.ConnectionPool({hosts: [\"localhost:9160\"]," +
"cqlVersion: \"3.0.0\"});"));

var cql, escaped = [], self = this;

if(args){
Expand Down

0 comments on commit 4ec3a8e

Please sign in to comment.