summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/Exception.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-06-06 20:23:28 +0000
committerAlan Conway <aconway@apache.org>2008-06-06 20:23:28 +0000
commitfb1f5c770c551fe526adf5b860dd72cf5eb07311 (patch)
tree79a0d3ccb278e51b9ec5213b038b903d768c2727 /cpp/src/qpid/Exception.cpp
parent76c922baf182bb367feed2ec014e7cab9db7f79d (diff)
downloadqpid-python-fb1f5c770c551fe526adf5b860dd72cf5eb07311.tar.gz
Added exceptions to sys::Waitable.
Fixed client side deadlock involving client::Bounds. Fixed incorrect exception messages during connection shutdown. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@664114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Exception.cpp')
-rw-r--r--cpp/src/qpid/Exception.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/qpid/Exception.cpp b/cpp/src/qpid/Exception.cpp
index 8176d92cac..28c9d3742b 100644
--- a/cpp/src/qpid/Exception.cpp
+++ b/cpp/src/qpid/Exception.cpp
@@ -34,18 +34,22 @@ std::string strError(int err) {
}
Exception::Exception(const std::string& msg) throw() : message(msg) {
- QPID_LOG(debug, "Exception: " << message);
+ QPID_LOG(debug, "Exception constructed: " << message);
}
Exception::~Exception() throw() {}
-std::string Exception::getPrefix() const { return "Exception"; }
+std::string Exception::getPrefix() const { return ""; }
std::string Exception::getMessage() const { return message; }
const char* Exception::what() const throw() {
- if (whatStr.empty())
- whatStr = getPrefix() + ": " + message;
+ // Construct the what string the first time it is needed.
+ if (whatStr.empty()) {
+ whatStr = getPrefix();
+ if (!whatStr.empty()) whatStr += ": ";
+ whatStr += message;
+ }
return whatStr.c_str();
}