Cleanup exceptions.
[command.git] / include / exception / optionFailedConversion.h
index e4004f943a9a1b740beb881cafe5d15d4a52f35a..335aaac2a2c787795f580d5394e8af95d54b23a4 100644 (file)
@@ -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) { }
 };
 
 }