
Alexander Fokin wrote:
It seems the way program_options deals with validation errors was changed in 1.42.
Constructor of validation_error now takes kind_t and option name and value. Before 1.42 it was possible to specify what exactly was wrong with the option value in the constructor of validation_error. Now I see no options but to subclass validation_error. Was this change intentional?
It would expect so. IIUC, the change was made so that code that catches validation_error can emit localized or otherwise customized error message. Maybe, there should be an additional parameter to specify details?
Also, documentation need to be fixed to reflect these changes. More precisely, the following line in "Custom Validators" section will lead to compilation error:
throw validation_error("invalid value");
Could you file an issue on http://svn.boost.org about this? Thanks, Volodya