-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix suppressing I/O error in parse_config_file #29
base: develop
Are you sure you want to change the base?
Conversation
Thanks for the patch, Johannes. I wonder whether it will be even better to do the check inside the
function - that way, the error reporting will be done in all cases, not just when the config file is passed via name. |
Since there is currently no way to let However, since exceptions are already used for various other kinds of errors, it might be more consistent to use them here as well. I do not know what the right solution would be. |
Since there was no progress about this pull request for a long time, I decided to start another attempt. I think it is fine that the caller of template<class charT>
basic_parsed_options<charT>
parse_config_file(std::basic_istream<charT>& is,
const options_description& desc,
bool allow_unregistered) must check itself if there was an error on the stream. I extended the documentation of this function to make it clear. Throwing an exception could also make the function incompatible with earlier versions which do not throw such exception. However, an caller of template<class charT>
basic_parsed_options<charT>
parse_config_file(const char* filename,
const options_description&,
bool allow_unregistered = false); cannot check the stream itself. I think it is important to fix this bug and to handle errors while reading the stream. |
Codecov Report
@@ Coverage Diff @@
## develop #29 +/- ##
==========================================
Coverage ? 49.92%
==========================================
Files ? 23
Lines ? 1388
Branches ? 709
==========================================
Hits ? 693
Misses ? 110
Partials ? 585
Continue to review full report at Codecov.
|
@vprus I noticed that you have already cherry-picked / rebased my changes for the master branch. This explains why I could not reproduce the issue anymore. This actually confused me quite some time ago. 😄 Is there a reason why
Also note that I added a test and made small changes on the documentation later. This changes did not end up in the master branch yet. Not sure if you want to integrate them. Otherwiese, we should maybe close the pull request at some point? |
corresponding issue: https://svn.boost.org/trac10/ticket/13125