23 #ifndef _IGNITE_IGNITE_ERROR
24 #define _IGNITE_IGNITE_ERROR
31 #include <ignite/common/common.h>
33 #define IGNITE_ERROR_1(code, part1) { \
34 std::stringstream stream; \
36 throw ignite::IgniteError(code, stream.str().c_str()); \
39 #define IGNITE_ERROR_2(code, part1, part2) { \
40 std::stringstream stream; \
41 stream << (part1) << (part2); \
42 throw ignite::IgniteError(code, stream.str().c_str()); \
45 #define IGNITE_ERROR_3(code, part1, part2, part3) { \
46 std::stringstream stream; \
47 stream << (part1) << (part2) << (part3); \
48 throw ignite::IgniteError(code, stream.str().c_str()); \
51 #define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
52 std::stringstream stream; \
53 stream << msg << " [" << key1 << "=" << (val1) << "]"; \
54 throw ignite::IgniteError(code, stream.str().c_str()); \
57 #define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
58 std::stringstream stream; \
59 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
60 throw ignite::IgniteError(code, stream.str().c_str()); \
63 #define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
64 std::stringstream stream; \
65 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
66 throw ignite::IgniteError(code, stream.str().c_str()); \
69 #define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
70 std::stringstream stream; \
71 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
72 throw ignite::IgniteError(code, stream.str().c_str()); \
76 # pragma warning(push)
77 # pragma warning(disable : 4275)
85 const int IGNITE_JNI_ERR_SUCCESS = 0;
86 const int IGNITE_JNI_ERR_GENERIC = 1;
87 const int IGNITE_JNI_ERR_JVM_INIT = 2;
88 const int IGNITE_JNI_ERR_JVM_ATTACH = 3;
94 class IGNITE_IMPORT_EXPORT
IgniteError :
public std::exception
98 static const int IGNITE_SUCCESS = 0;
101 static const int IGNITE_ERR_JVM_INIT = 1;
104 static const int IGNITE_ERR_JVM_ATTACH = 2;
107 static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
110 static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
113 static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
116 static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
119 static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
122 static const int IGNITE_ERR_MEMORY = 1001;
125 static const int IGNITE_ERR_BINARY = 1002;
128 static const int IGNITE_ERR_GENERIC = 2000;
131 static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
134 static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
137 static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
140 static const int IGNITE_ERR_INTERRUPTED = 2004;
143 static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
146 static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
149 static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
152 static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
155 static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
158 static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
161 static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
164 static const int IGNITE_ERR_CACHE = 2012;
167 static const int IGNITE_ERR_CACHE_LOADER = 2013;
170 static const int IGNITE_ERR_CACHE_WRITER = 2014;
173 static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
176 static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
179 static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
182 static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
185 static const int IGNITE_ERR_TX_TIMEOUT = 2019;
188 static const int IGNITE_ERR_TX_ROLLBACK = 2020;
191 static const int IGNITE_ERR_TX_HEURISTIC = 2021;
194 static const int IGNITE_ERR_AUTHENTICATION = 2022;
197 static const int IGNITE_ERR_SECURITY = 2023;
200 static const int IGNITE_ERR_UNKNOWN = -1;
255 int32_t GetCode() const;
262 const
char* GetText() const IGNITE_NO_THROW;
270 virtual const
char* what() const IGNITE_NO_THROW;
280 static
void SetError(const
int jniCode, const
char* jniCls, const
char* jniMsg,
IgniteError* err);
291 # pragma warning(pop)
294 #endif //_IGNITE_IGNITE_ERROR
Ignite error information.
Definition: ignite_error.h:94
Apache Ignite API.
Definition: cache.h:43