Details
-
Task
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
None
-
None
-
None
Description
CLIENT_ERR implicitly depends on a status variable being defined. It results in code like this:
mongocrypt_status_t *status;
|
status = crypt->status;
|
CLIENT_ERR ("cannot create context from uninitialized crypt");
|
return false;
|
Though CLIENT_ERR does support printf arguments, almost none of the cases use them. I think it'd be preferable to define a function like:
/* always returns false. */
|
bool _mongocrypt_status_fail (mongocrypt_status_t* status, const char* msg);
|
So code like the case above can be refactored into:
return _mongocrypt_status_fail (status, "cannot create context from uninitialized crypt");
|