- in python2.7 the message field return empty string because multiple arguments was passed to exception's object constructor
- the message field is deprecated since 2.6. In case YB is not interested in supporting python prior to 2.7 str(err) must be used instead of message field. In other case it seems reasonable to create helper function and use it everywhere
Testing
Tested locally and verified that proper error message is printed for the drop keyspace query.
ycqlsh> drop keyspace new;
NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 127.0.0.1:9042 datacenter1>: <Error from server: code=0000 [Server error] message="Server Error. Cannot delete keyspace which has table: k [id=d98ecdf7bfd9436ca627d6c7dbd22394], request: namespace { name: "new" }: NAMESPACE_IS_NOT_EMPTY (master error 14)
drop keyspace new;
^^^
(ql error -2)">})
Description Using python2.7, On running a
drop keyspace
query, incomplete error message is shown:Fix Quoting from https://github.com/yugabyte/cqlsh/pull/23#pullrequestreview-1867543110
Since the supported python version are python2.7 or python3.6+ and message field is deprecated since python2.6, the fix is to simply use str(err) instead of err.message
Testing Tested locally and verified that proper error message is printed for the
drop keyspace
query.