remove unnecessary formatMessage function
authorMichal Voců <michal@ruk.cuni.cz>
Mon, 10 Sep 2007 15:43:08 +0000 (15:43 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Mon, 10 Sep 2007 15:43:08 +0000 (15:43 +0000)
org.glite.jobid.api-cpp/interface/JobId.h

index 262e0b8..0c9b336 100755 (executable)
@@ -24,21 +24,12 @@ public:
         * \param[in] exception         Error message describing the exception.
         */
        JobIdError(std::string const& exception)
-               : std::runtime_error(formatMessage(exception))
+           : std::runtime_error(std::string("JobId: bad argument (") + exception + ")")
        {}
                
        virtual ~JobIdError() throw() 
        {}
 
-private:
-       /** Format message for this particular exception.
-        *
-        * Returns formatted string describing exception.
-        * \param[in] exception         Error message describing the exception.
-        */
-       std::string formatMessage(std::string const& exception) {
-         return std::string("JobId: bad argument ( ") +  exception + ")";
-       }
 };
 
 
@@ -201,6 +192,8 @@ JobId::JobId(JobId const& src)
        int ret = glite_jobid_dup(src.m_jobid, 
                                  &m_jobid);
        if(ret) {
+           // we rely on dup returning only ENOMEM on error
+           assert(ret == ENOMEM);
            throw std::bad_alloc();
        }
 }