]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/getopt.h
Move GetOpt exception handling to the .cpp file
[libs/core.git] / source / core / getopt.h
index 2aaceef836730aa24a966c3cfaa20bb9864e23a7..53c9ddf2f0100681099df40466e125914e5e74b3 100644 (file)
@@ -122,16 +122,7 @@ private:
                virtual void store() { }
 
                virtual void store(const std::string &a)
-               {
-                       try
-                       {
-                               data = lexical_cast<T>(a);
-                       }
-                       catch(const lexical_error &e)
-                       {
-                               throw usage_error("Invalid argument for --"+lng+" ("+e.what()+")");
-                       }
-               }
+               { data = lexical_cast<T>(a); }
        };
 
        template<typename T>
@@ -147,16 +138,7 @@ private:
                virtual void store() { }
 
                virtual void store(const std::string &a)
-               {
-                       try
-                       {
-                               data.push_back(lexical_cast<typename T::value_type>(a));
-                       }
-                       catch(const lexical_error &e)
-                       {
-                               throw usage_error("Invalid argument for --"+lng+" ("+e.what()+")");
-                       }
-               }
+               { data.push_back(lexical_cast<typename T::value_type>(a)); }
        };
 
        bool help;