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_STD = 1003;
 
  131         static const int IGNITE_ERR_GENERIC = 2000;
 
  134         static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
 
  137         static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
 
  140         static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
 
  143         static const int IGNITE_ERR_INTERRUPTED = 2004;
 
  146         static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
 
  149         static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
 
  152         static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
 
  155         static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
 
  158         static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
 
  161         static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
 
  164         static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
 
  167         static const int IGNITE_ERR_CACHE = 2012;
 
  170         static const int IGNITE_ERR_CACHE_LOADER = 2013;
 
  173         static const int IGNITE_ERR_CACHE_WRITER = 2014;
 
  176         static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
 
  179         static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
 
  182         static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
 
  185         static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
 
  188         static const int IGNITE_ERR_TX_TIMEOUT = 2019;
 
  191         static const int IGNITE_ERR_TX_ROLLBACK = 2020;
 
  194         static const int IGNITE_ERR_TX_HEURISTIC = 2021;
 
  197         static const int IGNITE_ERR_AUTHENTICATION = 2022;
 
  200         static const int IGNITE_ERR_SECURITY = 2023;
 
  203         static const int IGNITE_ERR_FUTURE_STATE = 2024;
 
  206         static const int IGNITE_ERR_NETWORK_FAILURE = 2025;
 
  209         static const int IGNITE_ERR_SECURE_CONNECTION_FAILURE = 2026;
 
  212         static const int IGNITE_ERR_TX_THIS_THREAD = 2027;
 
  215         static const int IGNITE_ERR_TX = 2028;
 
  219         static const int IGNITE_ERR_UNKNOWN = -1;
 
  274         int32_t GetCode() const;
 
  281         const 
char* GetText() const IGNITE_NO_THROW;
 
  289         virtual const 
char* what() const IGNITE_NO_THROW;
 
  299         static 
void SetError(const 
int jniCode, const 
char* jniCls, const 
char* jniMsg, 
IgniteError& err);
 
  310 #   pragma warning(pop) 
  313 #endif //_IGNITE_IGNITE_ERROR