-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-1643 Replace mongoc_uri_new for better exception message #720
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
Codecov Report
@@ Coverage Diff @@
## master #720 +/- ##
==========================================
- Coverage 94.28% 92.98% -1.30%
==========================================
Files 357 357
Lines 18655 19059 +404
==========================================
+ Hits 17588 17722 +134
- Misses 1067 1337 +270
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far! I left a couple of comments that might help with the failing tests on evergreen.
std::string invalid_schema = | ||
"Invalid URI Schema, expecting 'mongodb://' or 'mongodb+srv://': "; | ||
|
||
REQUIRE(e.what() == invalid_schema + e.code().message()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this test is necessary but I added it in the moment to make sure we were successfully getting the correct error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This works. There's also a REQUIRE_THROWS_WITH
that takes a regex so you can assert things like "the error contains the words invalid URI
" case-insensitively. But no need to change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
To merge:
- Hit the squash and merge button below.
- Remove any commit messages from the body box (the one on bottom)
- Ensure the commit message (in the top box) follows our standards (here). Leave the postfix "(CXX-1643 Replace mongoc_uri_new for better exception message #720)" too. That'll link to the PR.
- Click Confirm squash and merge
std::string invalid_schema = | ||
"Invalid URI Schema, expecting 'mongodb://' or 'mongodb+srv://': "; | ||
|
||
REQUIRE(e.what() == invalid_schema + e.code().message()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This works. There's also a REQUIRE_THROWS_WITH
that takes a regex so you can assert things like "the error contains the words invalid URI
" case-insensitively. But no need to change this.
No description provided.