From 248277697e369d951b6f2a5cd60401ccf9762923 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 4 Apr 2008 19:35:14 +0000 Subject: Minor cleanup of base Exception and python_tests script. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@644845 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/Exception.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'cpp/src/qpid/Exception.h') diff --git a/cpp/src/qpid/Exception.h b/cpp/src/qpid/Exception.h index ff62817719..2f934166a7 100644 --- a/cpp/src/qpid/Exception.h +++ b/cpp/src/qpid/Exception.h @@ -40,27 +40,15 @@ std::string strError(int err); class Exception : public std::exception { public: - explicit Exception(const std::string& message=std::string(), - const std::string& name=std::string(), - uint16_t code=0) throw(); - + explicit Exception(const std::string& message=std::string()) throw(); virtual ~Exception() throw(); - - // returns "name: message" virtual const char* what() const throw(); - virtual std::string getName() const throw(); - virtual std::string getMessage() const throw(); - virtual uint16_t getCode() const throw(); - - // FIXME aconway 2008-02-21: backwards compat, remove? - std::string str() const throw() { return getMessage(); } - + protected: + std::string getPrefix() const; private: - const std::string message; - const std::string name; - const uint16_t code; - const std::string whatStr; + std::string message; + mutable std::string whatStr; }; /** @@ -90,6 +78,7 @@ struct ConnectionException : public SessionException { struct ClosedException : public Exception { ClosedException(const std::string& msg=std::string()); + std::string getPrefix() const; }; } // namespace qpid -- cgit v1.2.1