diff options
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 { |