Exception: Cassandra::Errors::AlreadyExistsError

Inherits:
ConfigurationError show all
Defined in:
lib/cassandra/errors.rb

Overview

Raised when the query attempted to create a keyspace or a table that was already existing.

Examples:

Creating a table twice

session.execute("USE my_keyspace")
session.execute("CREATE TABLE users (user_id INT PRIMARY KEY)")
begin
  session.execute("CREATE TABLE users (user_id INT PRIMARY KEY)")
rescue Cassandra::Errors::AlreadyExistsError => e
  p ['already exists', e.keyspace, e.table]
end

See Also:

Instance Attribute Summary collapse

Method Summary

Methods included from ValidationError

#execution_info

Instance Attribute Details

#keyspaceString (readonly)



717
718
719
# File 'lib/cassandra/errors.rb', line 717

def keyspace
  @keyspace
end

#tableString? (readonly)



720
721
722
# File 'lib/cassandra/errors.rb', line 720

def table
  @table
end