diff options
| author | Gordon Sim <gsim@apache.org> | 2008-03-10 17:47:06 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-03-10 17:47:06 +0000 |
| commit | aeb6df01fad88c3202c9e30205ec60801d672d9c (patch) | |
| tree | 3be9e9f0a4ae6292d584d53a760349ac5b096b09 /cpp/src/qpid/Exception.h | |
| parent | 9348ffddf9dbeb1029a91f0804a5f3b1e22f8821 (diff) | |
| download | qpid-python-aeb6df01fad88c3202c9e30205ec60801d672d9c.tar.gz | |
Adjusted exception handling in c++ for final 0-10 path.
Converted some more tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@635618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Exception.h')
| -rw-r--r-- | cpp/src/qpid/Exception.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/cpp/src/qpid/Exception.h b/cpp/src/qpid/Exception.h index 00365018ba..ff62817719 100644 --- a/cpp/src/qpid/Exception.h +++ b/cpp/src/qpid/Exception.h @@ -63,16 +63,29 @@ class Exception : public std::exception const std::string whatStr; }; -struct ChannelException : public Exception { +/** + * I have made SessionException a common base for Channel- and + * Connection- Exceptions. This is not strictly correct but allows all + * model layer exceptions to be handled as SessionExceptions which is + * how they are classified in the final 0-10 specification. I.e. this + * is a temporary hack to allow the preview and final codepaths to + * co-exist with minimal changes. + */ + +struct SessionException : public Exception { const framing::ReplyCode code; - ChannelException(framing::ReplyCode code_, const std::string& message) + SessionException(framing::ReplyCode code_, const std::string& message) : Exception(message), code(code_) {} }; -struct ConnectionException : public Exception { - const framing::ReplyCode code; - ConnectionException(framing::ReplyCode code_, const std::string& message) - : Exception(message), code(code_) {} +struct ChannelException : public SessionException { + ChannelException(framing::ReplyCode code, const std::string& message) + : SessionException(code, message) {} +}; + +struct ConnectionException : public SessionException { + ConnectionException(framing::ReplyCode code, const std::string& message) + : SessionException(code, message) {} }; struct ClosedException : public Exception { |
