I have started using cassandraemon (Apache Cassandra NoSQL with C#) and I just wonder if there is any way to read "Why" value in exception being caught from executing CQL query?
When I do the following:
try
{
CqlResult createResult = context.ExecuteCqlQuery(createTableCql);
}
catch (Exception exc)
{
if (exc.Why.Contains("already existing"))
{ // Why = org.apache.cassandra.exceptions.AlreadyExistsException: Cannot add already existing column family "nameOfColumn" to keyspace "nameOfKeyspace"
}
}
I cannot access Why in exc in any way.
What I want to do is to check if table already exists. I know I can check it like here (How to check if a Cassandra table exists), however only in CQL3. The way described in this link does not help too because I get other exception with Why value "unconfigured columnfamily schema_columnfamilies".
I would like to know how to read content of "Why" in general because I may need it in other context in the future. And it does not simply return some kind of CqlResult value that I can check, it just throws an exception.
How to check value of "Why" in caught exception from executing CQL query?
Regards!
PS In order to avoid hidden crossposting: https://cassandraemon.codeplex.com/discussions/441028