mongoc_uri_new_with_error should set the passed bson_error_t on parsing error.
The following two cases do not set the error (and only log a warning).
mongodb://localhost/db?heartbeatfrequencyms=10 logs:
Invalid "heartbeatfrequencyms" of 10: must be at least 500
but does not set the error.
mongodb://localhost/db?zlibcompressionlevel=10 logs:
Invalid "zlibcompressionlevel" of 10: must be between -1 and 9
but does not set the error.
These are both validated internally with mongoc_uri_set_option_as_int32, which does not take a bson_error_t.
Let's make an internal _mongoc_uri_set_option_as_int32_with_error to pull the error out.