22 #ifndef _IGNITE_IGNITE_ERROR
23 #define _IGNITE_IGNITE_ERROR
30 #include <ignite/common/common.h>
32 #define IGNITE_ERROR_1(code, part1) { \
33 std::stringstream stream; \
35 throw ignite::IgniteError(code, stream.str().c_str()); \
38 #define IGNITE_ERROR_2(code, part1, part2) { \
39 std::stringstream stream; \
40 stream << (part1) << (part2); \
41 throw ignite::IgniteError(code, stream.str().c_str()); \
44 #define IGNITE_ERROR_3(code, part1, part2, part3) { \
45 std::stringstream stream; \
46 stream << (part1) << (part2) << (part3); \
47 throw ignite::IgniteError(code, stream.str().c_str()); \
50 #define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
51 std::stringstream stream; \
52 stream << msg << " [" << key1 << "=" << (val1) << "]"; \
53 throw ignite::IgniteError(code, stream.str().c_str()); \
56 #define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
57 std::stringstream stream; \
58 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
59 throw ignite::IgniteError(code, stream.str().c_str()); \
62 #define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
63 std::stringstream stream; \
64 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
65 throw ignite::IgniteError(code, stream.str().c_str()); \
68 #define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
69 std::stringstream stream; \
70 stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
71 throw ignite::IgniteError(code, stream.str().c_str()); \
75 # pragma warning(push)
76 # pragma warning(disable : 4275)
84 const int IGNITE_JNI_ERR_SUCCESS = 0;
85 const int IGNITE_JNI_ERR_GENERIC = 1;
86 const int IGNITE_JNI_ERR_JVM_INIT = 2;
87 const int IGNITE_JNI_ERR_JVM_ATTACH = 3;
93 class IGNITE_IMPORT_EXPORT
IgniteError :
public std::exception
97 static const int IGNITE_SUCCESS = 0;
100 static const int IGNITE_ERR_JVM_INIT = 1;
103 static const int IGNITE_ERR_JVM_ATTACH = 2;
106 static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
109 static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
112 static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
115 static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
118 static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
121 static const int IGNITE_ERR_MEMORY = 1001;
124 static const int IGNITE_ERR_BINARY = 1002;
127 static const int IGNITE_ERR_STD = 1003;
130 static const int IGNITE_ERR_GENERIC = 2000;
133 static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
136 static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
139 static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
142 static const int IGNITE_ERR_INTERRUPTED = 2004;
145 static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
148 static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
151 static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
154 static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
157 static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
160 static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
163 static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
166 static const int IGNITE_ERR_CACHE = 2012;
169 static const int IGNITE_ERR_CACHE_LOADER = 2013;
172 static const int IGNITE_ERR_CACHE_WRITER = 2014;
175 static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
178 static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
181 static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
184 static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
187 static const int IGNITE_ERR_TX_TIMEOUT = 2019;
190 static const int IGNITE_ERR_TX_ROLLBACK = 2020;
193 static const int IGNITE_ERR_TX_HEURISTIC = 2021;
196 static const int IGNITE_ERR_AUTHENTICATION = 2022;
199 static const int IGNITE_ERR_SECURITY = 2023;
202 static const int IGNITE_ERR_FUTURE_STATE = 2024;
205 static const int IGNITE_ERR_NETWORK_FAILURE = 2025;
208 static const int IGNITE_ERR_SECURE_CONNECTION_FAILURE = 2026;
211 static const int IGNITE_ERR_TX_THIS_THREAD = 2027;
214 static const int IGNITE_ERR_TX = 2028;
218 static const int IGNITE_ERR_UNKNOWN = -1;
273 int32_t GetCode() const;
280 const
char* GetText() const IGNITE_NO_THROW;
288 virtual const
char* what() const IGNITE_NO_THROW;
298 static
void SetError(const
int jniCode, const
char* jniCls, const
char* jniMsg,
IgniteError& err);
309 # pragma warning(pop)
312 #endif //_IGNITE_IGNITE_ERROR