Skip to content

Fixed PHPC-506: Use more descriptive messages in WriteExceptions #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Mar 1, 2016

@derickr derickr force-pushed the PHPC-506-more-descriptive-message-in-WriteExceptions branch 3 times, most recently from b79e7be to 056be36 Compare March 1, 2016 13:21
@derickr derickr force-pushed the PHPC-506-more-descriptive-message-in-WriteExceptions branch from 056be36 to 5c366ee Compare March 1, 2016 14:08
}

if (bson_iter_init_find(&inner_iter, &cbson, "errmsg") && BSON_ITER_HOLDS_UTF8(&inner_iter)) {
char *tmp_errmsg = bson_iter_dup_utf8(&inner_iter, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we can't simply use bson_iter_utf8() here, since tmp_errmsg is not going to be modified and we're just going to copy it into tmp_msg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason whatsoever - I didn't know it existed :-)

@jmikola jmikola merged commit fd356f3 into mongodb:master Mar 2, 2016
jmikola added a commit that referenced this pull request Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants