Improve error message when connect() is called with an invalid keyspace name

Description

Initial description:
If the keyspace name passed to Cluster#connect(String) is empty or null, the driver will still attempt to issue a USE ... query, leading to a CQL error.

Add a check of the string at the beginning of the method. We could either throw an IllegalArgumentException, or delegate to connect().


Resolution:
We eventually chose to just decorate the Cassandra error message to make it more explicit: "Error executing USE query ... check that your keyspace name is valid". Validating the keyspace name client-side duplicates Cassandra-side logic in the driver, which is something we generally try to avoid.
This error should be pretty rare, so making a roundtrip to Cassandra is not a big deal.

Environment

None

Pull Requests

None

Status

Assignee

Olivier Michallat

Reporter

Olivier Michallat

Labels

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Sprint

Priority

Trivial
Configure