stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
12 stars 16 forks source link

Rename misleading `ErrorCode.INVALID_COLLECTION_NAME` as `EXISTING_COLLECTION_DIFFERENT_SETTINGS` #1185

Closed tatu-at-datastax closed 1 week ago

tatu-at-datastax commented 1 week ago

Error code ErrorCode.INVALID_COLLECTION_NAME is used in case where createCollection fails due to Collection with given name existing but with different settings. This is misleading, in particular for metrics since although actual message:

Invalid collection name: provided collection ('%s') already exists with different collection options

explains problem bit better our metrics only contain actual ErrorCode. So while usually we try not to change ErrorCode constants, in this case it seems necessary to change it to improve Observability.

tatu-at-datastax commented 1 week ago

Proposing ErrorCode. EXISTING_COLLECTION_DIFFERENT_SETTINGS as the replacement name: easy to change with better suggestion.