Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef QPID_MESSAGING_EXCEPTIONS_H 00002 #define QPID_MESSAGING_EXCEPTIONS_H 00003 00004 /* 00005 * 00006 * Licensed to the Apache Software Foundation (ASF) under one 00007 * or more contributor license agreements. See the NOTICE file 00008 * distributed with this work for additional information 00009 * regarding copyright ownership. The ASF licenses this file 00010 * to you under the Apache License, Version 2.0 (the 00011 * "License"); you may not use this file except in compliance 00012 * with the License. You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, 00017 * software distributed under the License is distributed on an 00018 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00019 * KIND, either express or implied. See the License for the 00020 * specific language governing permissions and limitations 00021 * under the License. 00022 * 00023 */ 00024 00025 #include "qpid/messaging/ImportExport.h" 00026 #include "qpid/types/Exception.h" 00027 #include "qpid/types/Variant.h" 00028 00029 namespace qpid { 00030 namespace messaging { 00031 00035 struct MessagingException : public qpid::types::Exception 00036 { 00037 QPID_MESSAGING_EXTERN MessagingException(const std::string& msg); 00038 QPID_MESSAGING_EXTERN virtual ~MessagingException() throw(); 00039 00040 qpid::types::Variant::Map detail; 00041 //TODO: override what() to include detail if present 00042 }; 00043 00044 struct InvalidOptionString : public MessagingException 00045 { 00046 QPID_MESSAGING_EXTERN InvalidOptionString(const std::string& msg); 00047 }; 00048 00049 struct KeyError : public MessagingException 00050 { 00051 QPID_MESSAGING_EXTERN KeyError(const std::string&); 00052 }; 00053 00054 struct LinkError : public MessagingException 00055 { 00056 QPID_MESSAGING_EXTERN LinkError(const std::string&); 00057 }; 00058 00059 struct AddressError : public LinkError 00060 { 00061 QPID_MESSAGING_EXTERN AddressError(const std::string&); 00062 }; 00063 00068 struct ResolutionError : public AddressError 00069 { 00070 QPID_MESSAGING_EXTERN ResolutionError(const std::string& msg); 00071 }; 00072 00073 struct AssertionFailed : public ResolutionError 00074 { 00075 QPID_MESSAGING_EXTERN AssertionFailed(const std::string& msg); 00076 }; 00077 00078 struct NotFound : public ResolutionError 00079 { 00080 QPID_MESSAGING_EXTERN NotFound(const std::string& msg); 00081 }; 00082 00086 struct MalformedAddress : public AddressError 00087 { 00088 QPID_MESSAGING_EXTERN MalformedAddress(const std::string& msg); 00089 }; 00090 00091 struct ReceiverError : public LinkError 00092 { 00093 QPID_MESSAGING_EXTERN ReceiverError(const std::string&); 00094 }; 00095 00096 struct FetchError : public ReceiverError 00097 { 00098 QPID_MESSAGING_EXTERN FetchError(const std::string&); 00099 }; 00100 00101 struct NoMessageAvailable : public FetchError 00102 { 00103 QPID_MESSAGING_EXTERN NoMessageAvailable(); 00104 }; 00105 00106 struct SenderError : public LinkError 00107 { 00108 QPID_MESSAGING_EXTERN SenderError(const std::string&); 00109 }; 00110 00111 struct SendError : public SenderError 00112 { 00113 QPID_MESSAGING_EXTERN SendError(const std::string&); 00114 }; 00115 00116 struct TargetCapacityExceeded : public SendError 00117 { 00118 QPID_MESSAGING_EXTERN TargetCapacityExceeded(const std::string&); 00119 }; 00120 00121 struct SessionError : public MessagingException 00122 { 00123 QPID_MESSAGING_EXTERN SessionError(const std::string&); 00124 }; 00125 00126 struct TransactionError : public SessionError 00127 { 00128 QPID_MESSAGING_EXTERN TransactionError(const std::string&); 00129 }; 00130 00131 struct TransactionAborted : public TransactionError 00132 { 00133 QPID_MESSAGING_EXTERN TransactionAborted(const std::string&); 00134 }; 00135 00136 struct UnauthorizedAccess : public SessionError 00137 { 00138 QPID_MESSAGING_EXTERN UnauthorizedAccess(const std::string&); 00139 }; 00140 00141 struct ConnectionError : public MessagingException 00142 { 00143 QPID_MESSAGING_EXTERN ConnectionError(const std::string&); 00144 }; 00145 00146 struct TransportFailure : public MessagingException 00147 { 00148 QPID_MESSAGING_EXTERN TransportFailure(const std::string&); 00149 }; 00150 00151 }} // namespace qpid::messaging 00152 00153 #endif