[CXX-2329] options::server_api::version_from_string() throws the wrong type Created: 27/Jul/21 Updated: 28/Oct/23 Resolved: 04/Aug/21 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.0, 3.7.0-beta1 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Jesse Williamson (Inactive) | Assignee: | Jesse Williamson (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Description |
|
The doxygen documentation for version_from_string() claims to throw a mongocxx::logic_error on invalid argument, but instead throws a std::logic_error.
Note: as part of this change, I recommend investigating version_to_string() as well. |
| Comments |
| Comment by Jesse Williamson (Inactive) [ 04/Aug/21 ] | ||||||||||||||||
|
Users catching std::logic_error (what was actually thrown by the code, as opposed to what was documented) will need to update their code to catch mongocxx::logic_error (and check the error code to distinguish invalid_parameter from some other error). | ||||||||||||||||
| Comment by Githook User [ 30/Jul/21 ] | ||||||||||||||||
|
Author: {'name': 'Jesse Williamson', 'email': 'jesse.williamson@mongodb.com', 'username': 'chardan'}Message:
Modify exceptions throw to use mongocxx::logic_error. Adds std::error_code/std::errc plumbing, as mongocxx::exception See: https://jira.mongodb.org/browse/CXX-2329 Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
We provide our own error codes, and there's precedent for using Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com>
Signed-off-by: Jesse Williamson <jesse.williamson@mongodb.com> | ||||||||||||||||
| Comment by Jesse Williamson (Inactive) [ 27/Jul/21 ] | ||||||||||||||||
|
Sure enough, in options/server_api.cpp we see:
|