X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=include%2Fexception%2FoptionFailedConversion.h;h=335aaac2a2c787795f580d5394e8af95d54b23a4;hb=71d10208f91a566b40ea1bdbb1e2f20f85f8182f;hp=e4004f943a9a1b740beb881cafe5d15d4a52f35a;hpb=521027e1f566744a1b087cc3d047a714551d5f00;p=command.git diff --git a/include/exception/optionFailedConversion.h b/include/exception/optionFailedConversion.h index e4004f9..335aaac 100644 --- a/include/exception/optionFailedConversion.h +++ b/include/exception/optionFailedConversion.h @@ -7,21 +7,20 @@ namespace command { /** - * Helper template class used for releasing resources. + * Exception thrown used when Option's value failed conversion to specific type + * + * e.g.: + * "a" -> int */ class OptionFailedConversion : public std::invalid_argument { -protected: - std::string message; public: + /** \inheritdoc */ explicit OptionFailedConversion(const std::string& what_arg) : - std::invalid_argument(what_arg), message(what_arg) { } + std::invalid_argument(what_arg) { } + /** \inheritdoc */ explicit OptionFailedConversion(const char* what_arg) : - std::invalid_argument(what_arg), message(what_arg) { } - - virtual const char* what() const throw() { - return message.c_str(); - } + std::invalid_argument(what_arg) { } }; }