Michael Fero
unread,Mar 22, 2015, 10:15:34 AM3/22/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cpp-dri...@lists.datastax.com
Karl,
Using the following keyspaces and tables:
CREATE KEYSPACE examples WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
CREATE TABLE examples.detailed_error_message (key text, PRIMARY KEY (key));
... you can get a more detailed error message from the future using the example code below:
CassError rc = CASS_OK;
CassStatement* statement = NULL;
CassFuture* future = NULL;
CassString query = cass_string_init("SELECT * FROM examples.detailed_error_message WHERE foo = 'bar'");
statement = cass_statement_new(query, 0);
future = cass_session_execute(session, statement);
cass_future_wait(future);
/* Retrieve error message from future and display */
rc = cass_future_error_code(future);
if(rc != CASS_OK) {
CassString message = cass_future_error_message(future);
fprintf(stderr, "Error: %.*s\n", (int) message.length, message.data);
}
cass_future_free(future);
cass_statement_free(statement);
This code with your query statement would yield the following error message:
Error: Undefined name foo in where clause ('foo = 'bar'')
~Fero