From 6928c50229da25bf0870f570d96f81161284b13d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Mon, 10 Sep 2007 15:43:08 +0000 Subject: [PATCH] remove unnecessary formatMessage function --- org.glite.jobid.api-cpp/interface/JobId.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/org.glite.jobid.api-cpp/interface/JobId.h b/org.glite.jobid.api-cpp/interface/JobId.h index 262e0b8..0c9b336 100755 --- a/org.glite.jobid.api-cpp/interface/JobId.h +++ b/org.glite.jobid.api-cpp/interface/JobId.h @@ -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(); } } -- 1.8.2.3