Change CLIENT_ERR to a function

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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");
      

            Assignee:
            Unassigned
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: