Uh oh!
There was an error while loading. Please reload this page.
fix suppressing I/O error in parse_config_file - #29
Conversation
vprus
commented
Jul 24, 2017
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. |
JojOatXGME
commented
Jul 24, 2017
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<classcharT>
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<classcharT>
basic_parsed_options<charT>
parse_config_file(constchar* 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