19 #ifndef HAZELCAST_CLIENT_EXCEPTION_PROTOCOLEXCEPTIONS_H_
20 #define HAZELCAST_CLIENT_EXCEPTION_PROTOCOLEXCEPTIONS_H_
24 #include "hazelcast/client/exception/IException.h"
26 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
28 #pragma warning(disable: 4251) //for dll export
36 ProtocolException(
const std::string& message,
const std::string& details, int32_t errorNo,
38 :
IException(
"Cluster", details), errorCode(errorNo), causeErrorCode(causeCode) {
42 :
IException(source, message), errorCode(-1), causeErrorCode(-1) {
45 int32_t getErrorCode()
const {
49 int32_t getCauseErrorCode()
const {
50 return causeErrorCode;
54 int32_t causeErrorCode;
57 #define DEFINE_PROTOCOL_EXCEPTION(ClassName) \
58 class HAZELCAST_API ClassName : public ProtocolException {\
60 ClassName(const std::string& message, const std::string& details, int32_t errorNo, int32_t causeCode) \
61 : ProtocolException(message, details, errorNo, causeCode) {\
63 ClassName(const std::string& source, const std::string& message) \
64 : ProtocolException(source, message) {\
66 ClassName(const std::string& source) : ProtocolException(source, "") {\
68 virtual void raise() {\
73 DEFINE_PROTOCOL_EXCEPTION(ArrayIndexOutOfBoundsException);
74 DEFINE_PROTOCOL_EXCEPTION(ArrayStoreException);
75 DEFINE_PROTOCOL_EXCEPTION(AuthenticationException);
76 DEFINE_PROTOCOL_EXCEPTION(CacheNotExistsException);
77 DEFINE_PROTOCOL_EXCEPTION(CallerNotMemberException);
78 DEFINE_PROTOCOL_EXCEPTION(CancellationException);
79 DEFINE_PROTOCOL_EXCEPTION(ClassCastException);
80 DEFINE_PROTOCOL_EXCEPTION(ClassNotFoundException);
81 DEFINE_PROTOCOL_EXCEPTION(ConcurrentModificationException);
82 DEFINE_PROTOCOL_EXCEPTION(ConfigMismatchException);
83 DEFINE_PROTOCOL_EXCEPTION(ConfigurationException);
84 DEFINE_PROTOCOL_EXCEPTION(DistributedObjectDestroyedException);
85 DEFINE_PROTOCOL_EXCEPTION(DuplicateInstanceNameException);
86 DEFINE_PROTOCOL_EXCEPTION(EOFException);
87 DEFINE_PROTOCOL_EXCEPTION(ExecutionException);
88 DEFINE_PROTOCOL_EXCEPTION(HazelcastException);
89 DEFINE_PROTOCOL_EXCEPTION(HazelcastInstanceNotActiveException);
90 DEFINE_PROTOCOL_EXCEPTION(HazelcastOverloadException);
91 DEFINE_PROTOCOL_EXCEPTION(HazelcastSerializationException);
92 DEFINE_PROTOCOL_EXCEPTION(IOException);
93 DEFINE_PROTOCOL_EXCEPTION(IllegalArgumentException);
94 DEFINE_PROTOCOL_EXCEPTION(IllegalAccessException);
95 DEFINE_PROTOCOL_EXCEPTION(IllegalAccessError);
96 DEFINE_PROTOCOL_EXCEPTION(IllegalMonitorStateException);
97 DEFINE_PROTOCOL_EXCEPTION(IllegalStateException);
98 DEFINE_PROTOCOL_EXCEPTION(IllegalThreadStateException);
99 DEFINE_PROTOCOL_EXCEPTION(IndexOutOfBoundsException);
100 DEFINE_PROTOCOL_EXCEPTION(InterruptedException);
101 DEFINE_PROTOCOL_EXCEPTION(InvalidAddressException);
102 DEFINE_PROTOCOL_EXCEPTION(InvalidConfigurationException);
103 DEFINE_PROTOCOL_EXCEPTION(MemberLeftException);
104 DEFINE_PROTOCOL_EXCEPTION(NegativeArraySizeException);
105 DEFINE_PROTOCOL_EXCEPTION(NoSuchElementException);
106 DEFINE_PROTOCOL_EXCEPTION(NotSerializableException);
107 DEFINE_PROTOCOL_EXCEPTION(NullPointerException);
108 DEFINE_PROTOCOL_EXCEPTION(OperationTimeoutException);
109 DEFINE_PROTOCOL_EXCEPTION(PartitionMigratingException);
110 DEFINE_PROTOCOL_EXCEPTION(QueryException);
111 DEFINE_PROTOCOL_EXCEPTION(QueryResultSizeExceededException);
112 DEFINE_PROTOCOL_EXCEPTION(QuorumException);
113 DEFINE_PROTOCOL_EXCEPTION(ReachedMaxSizeException);
114 DEFINE_PROTOCOL_EXCEPTION(RejectedExecutionException);
115 DEFINE_PROTOCOL_EXCEPTION(RemoteMapReduceException);
116 DEFINE_PROTOCOL_EXCEPTION(ResponseAlreadySentException);
117 DEFINE_PROTOCOL_EXCEPTION(RetryableHazelcastException);
118 DEFINE_PROTOCOL_EXCEPTION(RetryableIOException);
119 DEFINE_PROTOCOL_EXCEPTION(RuntimeException);
120 DEFINE_PROTOCOL_EXCEPTION(SecurityException);
121 DEFINE_PROTOCOL_EXCEPTION(SocketException);
125 DEFINE_PROTOCOL_EXCEPTION(StaleSequenceException);
126 DEFINE_PROTOCOL_EXCEPTION(TargetDisconnectedException);
127 DEFINE_PROTOCOL_EXCEPTION(TargetNotMemberException);
128 DEFINE_PROTOCOL_EXCEPTION(TimeoutException);
129 DEFINE_PROTOCOL_EXCEPTION(TopicOverloadException);
130 DEFINE_PROTOCOL_EXCEPTION(TopologyChangedException);
131 DEFINE_PROTOCOL_EXCEPTION(TransactionException);
132 DEFINE_PROTOCOL_EXCEPTION(TransactionNotActiveException);
133 DEFINE_PROTOCOL_EXCEPTION(TransactionTimedOutException);
134 DEFINE_PROTOCOL_EXCEPTION(URISyntaxException);
135 DEFINE_PROTOCOL_EXCEPTION(UTFDataFormatException);
136 DEFINE_PROTOCOL_EXCEPTION(UnsupportedOperationException);
137 DEFINE_PROTOCOL_EXCEPTION(WrongTargetException);
138 DEFINE_PROTOCOL_EXCEPTION(XAException);
139 DEFINE_PROTOCOL_EXCEPTION(AccessControlException);
140 DEFINE_PROTOCOL_EXCEPTION(LoginException);
141 DEFINE_PROTOCOL_EXCEPTION(UnsupportedCallbackException);
142 DEFINE_PROTOCOL_EXCEPTION(NoDataMemberInClusterException);
143 DEFINE_PROTOCOL_EXCEPTION(ReplicatedMapCantBeCreatedOnLiteMemberException);
144 DEFINE_PROTOCOL_EXCEPTION(MaxMessageSizeExceeded);
145 DEFINE_PROTOCOL_EXCEPTION(WANReplicationQueueFullException);
146 DEFINE_PROTOCOL_EXCEPTION(AssertionError);
147 DEFINE_PROTOCOL_EXCEPTION(OutOfMemoryError);
148 DEFINE_PROTOCOL_EXCEPTION(StackOverflowError);
149 DEFINE_PROTOCOL_EXCEPTION(NativeOutOfMemoryError);
150 DEFINE_PROTOCOL_EXCEPTION(ServiceNotFoundException);
155 : error(errorCode), messageCallId(correlationId), detailedErrorMessage(details) {
161 int32_t getErrorCode()
const {
165 int64_t getMessageCallId()
const {
166 return messageCallId;
169 const std::string &getDetailedErrorMessage()
const {
170 return detailedErrorMessage;
175 int64_t messageCallId;
176 std::string detailedErrorMessage;
188 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
192 #endif //HAZELCAST_CLIENT_EXCEPTION_PROTOCOLEXCEPTIONS_H_
Definition: ProtocolExceptions.h:179
Base class for all exception originated from Hazelcast methods.
Definition: IException.h:49
Definition: ProtocolExceptions.h:34
Definition: MapEntryView.h:32
Definition: ProtocolExceptions.h:152