scassandra / scassandra-server

Stubbed Cassandra
http://www.scassandra.org
Other
87 stars 34 forks source link

Handle invalid types with an informative error message, update docs. #150

Closed tolbertam closed 8 years ago

tolbertam commented 8 years ago

Noticed that some of the docs inappropriately reference a 'set' column_type without providing a parameterized value. This used to work but no longer does, when it does the error returned is not very useful:

The request content was malformed:

Updated ColumnType.fromString to handle any parsing errors emitted by CqlTypeFactory.buildType and returning Try instead of Option and then handling the Failure case in PrimingJsonImplicits.ColumnTypeJsonFormat.

The error now includes the relevant info:

The request content was malformed:
Not a valid column type 'set'

and the full stack trace is emitted in the logs.