Background
cass_cluster_set_application_name_n
I wonder if this is the proper way of handling this. It will fail mostly silently - only signal will be an entry in the logs.
Perhaps a panic is warranted here?
Originally posted by @Lorak-mmk in #448 (comment)
Problem
There are quite a lot of public API functions that return void, yet still may fail. Currently, upon error we issue an error! log message, followed by an early return.
@Lorak-mmk correctly noted that this may easily go unnoticed, causing silent bugs. To combat this, he proposed panicking in critical conditions.
Still needs to be settled
It's up to further discussion which error conditions shall be considered critical (and warrant a panic) and which not (so the error log is enough).
For now, we have the following examples of functions falling into each of these categories:
Critical errors
cass_cluster_set_credentials - if it fails, we will likely be unable to connect to the cluster and execute any statements.
Noncritical errors
cass_cluster_set_application_{name,version} - failure to advertise the desired name of the application for the cluster is by far not something that stop driver from doing its work.
Background
Originally posted by @Lorak-mmk in #448 (comment)
Problem
There are quite a lot of public API functions that return
void, yet still may fail. Currently, upon error we issue anerror!log message, followed by an early return.@Lorak-mmk correctly noted that this may easily go unnoticed, causing silent bugs. To combat this, he proposed panicking in critical conditions.
Still needs to be settled
It's up to further discussion which error conditions shall be considered critical (and warrant a panic) and which not (so the error log is enough).
For now, we have the following examples of functions falling into each of these categories:
Critical errors
cass_cluster_set_credentials- if it fails, we will likely be unable to connect to the cluster and execute any statements.Noncritical errors
cass_cluster_set_application_{name,version}- failure to advertise the desired name of the application for the cluster is by far not something that stop driver from doing its work.