ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/3] ignite git commit: IGNITE-1364: GridError -> IgniteError.
Date Thu, 03 Sep 2015 11:09:36 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/grid_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid_error.h b/modules/platform/src/main/cpp/core/include/ignite/grid_error.h
deleted file mode 100644
index 7b1dd8e..0000000
--- a/modules/platform/src/main/cpp/core/include/ignite/grid_error.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_GRID_ERROR
-#define _IGNITE_GRID_ERROR
-
-#include <sstream>
-#include <stdint.h>
-
-#include <ignite/common/common.h>
-
-#define IGNITE_ERROR_1(code, part1) { \
-    std::stringstream stream; \
-    stream << (part1); \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_2(code, part1, part2) { \
-    std::stringstream stream; \
-    stream << (part1) << (part2); \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_3(code, part1, part2, part3) { \
-    std::stringstream stream; \
-    stream << (part1) << (part2) << (part3); \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << "]"; \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
-    std::stringstream stream; \
-    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
-    throw ignite::GridError(code, stream.str().c_str()); \
-}
-
-namespace ignite
-{
-    /**
-     * Grid error information.
-     */
-    class IGNITE_IMPORT_EXPORT GridError
-    {
-    public:
-        /** Success. */
-        static const int IGNITE_SUCCESS = 0;
-
-        /** Failed to initialize JVM. */
-        static const int IGNITE_ERR_JVM_INIT = 1;
-
-        /** Failed to attach to JVM. */
-        static const int IGNITE_ERR_JVM_ATTACH = 2;
-        
-        /** JVM library is not found. */
-        static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
-
-        /** Failed to load JVM library. */
-        static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
-        
-        /** JVM classpath is not provided. */
-        static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
-
-        /** JVM error: no class definition found. */
-        static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
-
-        /** JVM error: no such method. */
-        static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
-
-        /** Memory operation error. */
-        static const int IGNITE_ERR_MEMORY = 1001;
-
-        /** Portable error. */
-        static const int IGNITE_ERR_PORTABLE = 1002;
-
-        /** Generic Ignite error. */
-        static const int IGNITE_ERR_GENERIC = 2000;
-
-        /** Illegal argument passed. */
-        static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
-
-        /** Illegal state. */
-        static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
-
-        /** Unsupported operation. */
-        static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
-
-        /** Thread has been interrup. */
-        static const int IGNITE_ERR_INTERRUPTED = 2004;
-
-        /** Cluster group is empty. */
-        static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
-
-        /** Cluster topology problem. */
-        static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
-
-        /** Compute execution rejected. */
-        static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
-
-        /** Compute job failover. */
-        static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
-
-        /** Compute task cancelled. */
-        static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
-
-        /** Compute task timeout. */
-        static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
-
-        /** Compute user undeclared exception. */
-        static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
-
-        /** Generic cache error. */
-        static const int IGNITE_ERR_CACHE = 2012;
-
-        /** Generic cache loader error. */
-        static const int IGNITE_ERR_CACHE_LOADER = 2013;
-
-        /** Generic cache writer error. */
-        static const int IGNITE_ERR_CACHE_WRITER = 2014;
-        
-        /** Generic cache entry processor error. */
-        static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
-
-        /** Cache atomic update timeout. */
-        static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
-
-        /** Cache partial update. */
-        static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
-        
-        /** Transaction optimisitc exception. */
-        static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
-
-        /** Transaction timeout. */
-        static const int IGNITE_ERR_TX_TIMEOUT = 2019;
-
-        /** Transaction rollback. */
-        static const int IGNITE_ERR_TX_ROLLBACK = 2020;
-
-        /** Transaction heuristic exception. */
-        static const int IGNITE_ERR_TX_HEURISTIC = 2021;
-
-        /** Authentication error. */
-        static const int IGNITE_ERR_AUTHENTICATION = 2022;
-
-        /** Security error. */
-        static const int IGNITE_ERR_SECURITY = 2023;
-        
-        /** Unknown error. */
-        static const int IGNITE_ERR_UNKNOWN = -1;
-
-        /**
-         * Throw an error if code is not IGNITE_SUCCESS.
-         *
-         * @param err Error.
-         */
-        static void ThrowIfNeeded(GridError& err);
-
-        /**
-         * Create empty error.
-         */
-        GridError();
-
-        /**
-         * Create error with specific code.
-         *
-         * @param code Error code.
-         */
-        GridError(const int32_t code);
-
-        /**
-         * Create error with specific code and message.
-         *
-         * @param code Error code.
-         * @param msg Message.
-         */
-        GridError(const int32_t code, const char* msg);
-        
-        /**
-         * Copy constructor.
-         *
-         * @param other Other instance.
-         */
-        GridError(const GridError& other);
-
-        /**
-         * Assignment operator.
-         *
-         * @param other Other instance.
-         * @return Assignment result.
-         */
-        GridError& operator=(const GridError& other);
-
-        /**
-         * Destructor.
-         */
-        ~GridError();
-
-        /**
-         * Get error code.
-         *
-         * @return Error code.
-         */
-        int32_t GetCode();
-
-        /**
-         * Get error message.
-         *
-         * @return Error message.
-         */
-        const char* GetText();
-        
-        /**
-         * Set error.
-         *
-         * @param jniCode Error code.
-         * @param jniCls Error class.
-         * @param jniMsg Error message.
-         * @param err Error.
-         */
-        static void SetError(const int jniCode, const char* jniCls, const char* jniMsg, GridError* err);
-    private:
-        /** Error code. */
-        int32_t code;    
-        
-        /** Error message. */
-        char* msg;       
-    };    
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h b/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
index 5ed9c16..0c8fc25 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/grid_factory.h
@@ -61,7 +61,7 @@
 
 #include "ignite/grid.h"
 #include "ignite/grid_configuration.h"
-#include "ignite/grid_error.h"
+#include "ignite/ignite_error.h"
 
 namespace ignite
 {
@@ -86,7 +86,7 @@ namespace ignite
          * @param err Error.
          * @return Grid instance or null in case of error.
          */
-        static Grid Start(const GridConfiguration& cfg, GridError* err);
+        static Grid Start(const GridConfiguration& cfg, IgniteError* err);
 
         /**
          * Start grid instance with specific name.
@@ -105,7 +105,7 @@ namespace ignite
          * @param err Error.
          * @return Grid instance or null in case of error.
          */
-        static Grid Start(const GridConfiguration& cfg, const char* name, GridError* err);
+        static Grid Start(const GridConfiguration& cfg, const char* name, IgniteError* err);
 
         /**
          * Get default grid instance.
@@ -120,7 +120,7 @@ namespace ignite
          * @param err Error.
          * @return Grid instance.
          */
-        static Grid Get(GridError* err);
+        static Grid Get(IgniteError* err);
 
         /**
          * Get grid instance with the given name.
@@ -137,7 +137,7 @@ namespace ignite
          * @param err Error.
          * @return Grid instance.
          */
-        static Grid Get(const char* name, GridError* err);
+        static Grid Get(const char* name, IgniteError* err);
 
         /**
          * Stop default grid instance.
@@ -154,7 +154,7 @@ namespace ignite
          * @param err Error.
          * @return True if grid instance was stopped by this call.
          */
-        static bool Stop(const bool cancel, GridError* err);
+        static bool Stop(const bool cancel, IgniteError* err);
 
         /**
          * Stop grid instance with the given name.
@@ -173,7 +173,7 @@ namespace ignite
          * @param err Error.
          * @return True if grid instance was stopped by this call.
          */
-        static bool Stop(const char* name, const bool cancel, GridError* err);
+        static bool Stop(const char* name, const bool cancel, IgniteError* err);
 
         /**
          * Stop all running grid instances.
@@ -188,7 +188,7 @@ namespace ignite
          * @param cancel Cancel flag.
          * @param err Error.
          */
-        static void StopAll(const bool cancel, GridError* err);
+        static void StopAll(const bool cancel, IgniteError* err);
     };    
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h b/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
new file mode 100644
index 0000000..eb95adc
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/include/ignite/ignite_error.h
@@ -0,0 +1,260 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_ERROR
+#define _IGNITE_ERROR
+
+#include <sstream>
+#include <stdint.h>
+
+#include <ignite/common/common.h>
+
+#define IGNITE_ERROR_1(code, part1) { \
+    std::stringstream stream; \
+    stream << (part1); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_2(code, part1, part2) { \
+    std::stringstream stream; \
+    stream << (part1) << (part2); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_3(code, part1, part2, part3) { \
+    std::stringstream stream; \
+    stream << (part1) << (part2) << (part3); \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4) { \
+    std::stringstream stream; \
+    stream << msg << " [" << key1 << "=" << (val1) << ", " << key2 << "=" << (val2) << ", " << key3 << "=" << (val3) << ", " << key4 << "=" << (val4) << "]"; \
+    throw ignite::IgniteError(code, stream.str().c_str()); \
+}
+
+namespace ignite
+{
+    /**
+     * Grid error information.
+     */
+    class IGNITE_IMPORT_EXPORT IgniteError
+    {
+    public:
+        /** Success. */
+        static const int IGNITE_SUCCESS = 0;
+
+        /** Failed to initialize JVM. */
+        static const int IGNITE_ERR_JVM_INIT = 1;
+
+        /** Failed to attach to JVM. */
+        static const int IGNITE_ERR_JVM_ATTACH = 2;
+        
+        /** JVM library is not found. */
+        static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
+
+        /** Failed to load JVM library. */
+        static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
+        
+        /** JVM classpath is not provided. */
+        static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
+
+        /** JVM error: no class definition found. */
+        static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
+
+        /** JVM error: no such method. */
+        static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
+
+        /** Memory operation error. */
+        static const int IGNITE_ERR_MEMORY = 1001;
+
+        /** Portable error. */
+        static const int IGNITE_ERR_PORTABLE = 1002;
+
+        /** Generic Ignite error. */
+        static const int IGNITE_ERR_GENERIC = 2000;
+
+        /** Illegal argument passed. */
+        static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
+
+        /** Illegal state. */
+        static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
+
+        /** Unsupported operation. */
+        static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
+
+        /** Thread has been interrup. */
+        static const int IGNITE_ERR_INTERRUPTED = 2004;
+
+        /** Cluster group is empty. */
+        static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
+
+        /** Cluster topology problem. */
+        static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
+
+        /** Compute execution rejected. */
+        static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
+
+        /** Compute job failover. */
+        static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
+
+        /** Compute task cancelled. */
+        static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
+
+        /** Compute task timeout. */
+        static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
+
+        /** Compute user undeclared exception. */
+        static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
+
+        /** Generic cache error. */
+        static const int IGNITE_ERR_CACHE = 2012;
+
+        /** Generic cache loader error. */
+        static const int IGNITE_ERR_CACHE_LOADER = 2013;
+
+        /** Generic cache writer error. */
+        static const int IGNITE_ERR_CACHE_WRITER = 2014;
+        
+        /** Generic cache entry processor error. */
+        static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
+
+        /** Cache atomic update timeout. */
+        static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
+
+        /** Cache partial update. */
+        static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
+        
+        /** Transaction optimisitc exception. */
+        static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
+
+        /** Transaction timeout. */
+        static const int IGNITE_ERR_TX_TIMEOUT = 2019;
+
+        /** Transaction rollback. */
+        static const int IGNITE_ERR_TX_ROLLBACK = 2020;
+
+        /** Transaction heuristic exception. */
+        static const int IGNITE_ERR_TX_HEURISTIC = 2021;
+
+        /** Authentication error. */
+        static const int IGNITE_ERR_AUTHENTICATION = 2022;
+
+        /** Security error. */
+        static const int IGNITE_ERR_SECURITY = 2023;
+        
+        /** Unknown error. */
+        static const int IGNITE_ERR_UNKNOWN = -1;
+
+        /**
+         * Throw an error if code is not IGNITE_SUCCESS.
+         *
+         * @param err Error.
+         */
+        static void ThrowIfNeeded(IgniteError& err);
+
+        /**
+         * Create empty error.
+         */
+        IgniteError();
+
+        /**
+         * Create error with specific code.
+         *
+         * @param code Error code.
+         */
+        IgniteError(const int32_t code);
+
+        /**
+         * Create error with specific code and message.
+         *
+         * @param code Error code.
+         * @param msg Message.
+         */
+        IgniteError(const int32_t code, const char* msg);
+        
+        /**
+         * Copy constructor.
+         *
+         * @param other Other instance.
+         */
+        IgniteError(const IgniteError& other);
+
+        /**
+         * Assignment operator.
+         *
+         * @param other Other instance.
+         * @return Assignment result.
+         */
+        IgniteError& operator=(const IgniteError& other);
+
+        /**
+         * Destructor.
+         */
+        ~IgniteError();
+
+        /**
+         * Get error code.
+         *
+         * @return Error code.
+         */
+        int32_t GetCode();
+
+        /**
+         * Get error message.
+         *
+         * @return Error message.
+         */
+        const char* GetText();
+        
+        /**
+         * Set error.
+         *
+         * @param jniCode Error code.
+         * @param jniCls Error class.
+         * @param jniMsg Error message.
+         * @param err Error.
+         */
+        static void SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err);
+    private:
+        /** Error code. */
+        int32_t code;    
+        
+        /** Error message. */
+        char* msg;       
+    };    
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
index 7862957..c797c29 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/cache_impl.h
@@ -64,7 +64,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                bool IsEmpty(GridError* err);
+                bool IsEmpty(IgniteError* err);
 
                 /**
                  * Perform ContainsKey.
@@ -73,7 +73,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                bool ContainsKey(InputOperation& inOp, GridError* err);
+                bool ContainsKey(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform ContainsKeys.
@@ -82,7 +82,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                bool ContainsKeys(InputOperation& inOp, GridError* err);
+                bool ContainsKeys(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform LocalPeek.
@@ -93,7 +93,7 @@ namespace ignite
                  * @param err Error.
                  */
                 void LocalPeek(InputOperation& inOp, OutputOperation& outOp, 
-                    int32_t peekModes, GridError* err);
+                    int32_t peekModes, IgniteError* err);
 
                 /**
                  * Perform Get.
@@ -102,7 +102,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void Get(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void Get(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
                 
                 /**
                  * Perform GetAll.
@@ -111,7 +111,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void GetAll(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void GetAll(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
 
                 /**
                  * Perform Put.
@@ -119,7 +119,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void Put(InputOperation& inOp, GridError* err);
+                void Put(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform PutAll.
@@ -127,7 +127,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void PutAll(InputOperation& inOp, GridError* err);
+                void PutAll(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform GetAndPut.
@@ -136,7 +136,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void GetAndPut(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void GetAndPut(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
 
                 /**
                  * Perform GetAndReplace.
@@ -145,7 +145,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void GetAndReplace(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
 
                 /**
                  * Perform GetAndRemove.
@@ -154,7 +154,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void GetAndRemove(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
 
                 /**
                  * Perform PutIfAbsent.
@@ -163,7 +163,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result
                  */
-                bool PutIfAbsent(InputOperation& inOp, GridError* err);
+                bool PutIfAbsent(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform GetAndPutIfAbsent.
@@ -172,7 +172,7 @@ namespace ignite
                  * @param outOp Output.
                  * @param err Error.
                  */
-                void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, GridError* err);
+                void GetAndPutIfAbsent(InputOperation& inOp, OutputOperation& outOp, IgniteError* err);
 
                 /**
                  * Perform Replace(K, V).
@@ -181,7 +181,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result
                  */
-                bool Replace(InputOperation& inOp, GridError* err);
+                bool Replace(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform Replace(K, V, V).
@@ -190,7 +190,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result
                  */
-                bool ReplaceIfEqual(InputOperation& inOp, GridError* err);
+                bool ReplaceIfEqual(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform LocalEvict.
@@ -198,14 +198,14 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void LocalEvict(InputOperation& inOp, GridError* err);
+                void LocalEvict(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform Clear.
                  *
                  * @param err Error.
                  */
-                void Clear(GridError* err);
+                void Clear(IgniteError* err);
 
                 /**
                  * Perform Clear.
@@ -213,7 +213,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void Clear(InputOperation& inOp, GridError* err);
+                void Clear(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform ClearAll.
@@ -221,7 +221,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void ClearAll(InputOperation& inOp, GridError* err);
+                void ClearAll(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform LocalClear.
@@ -229,7 +229,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void LocalClear(InputOperation& inOp, GridError* err);
+                void LocalClear(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform LocalClearAll.
@@ -237,7 +237,7 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void LocalClearAll(InputOperation& inOp, GridError* err);
+                void LocalClearAll(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform Remove(K).
@@ -246,7 +246,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result
                  */
-                bool Remove(InputOperation& inOp, GridError* err);
+                bool Remove(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform Remove(K, V).
@@ -255,7 +255,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result
                  */
-                bool RemoveIfEqual(InputOperation& inOp, GridError* err);
+                bool RemoveIfEqual(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform RemoveAll.
@@ -263,14 +263,14 @@ namespace ignite
                  * @param inOp Input.
                  * @param err Error.
                  */
-                void RemoveAll(InputOperation& inOp, GridError* err);
+                void RemoveAll(InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Perform RemoveAll.
                  *
                  * @param err Error.
                  */
-                void RemoveAll(GridError* err);
+                void RemoveAll(IgniteError* err);
 
                 /**
                  * Perform Size.
@@ -279,7 +279,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                int32_t Size(const int32_t peekModes, GridError* err);
+                int32_t Size(const int32_t peekModes, IgniteError* err);
 
                 /**
                  * Perform LocalSize.
@@ -288,7 +288,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                int32_t LocalSize(const int32_t peekModes, GridError* err);
+                int32_t LocalSize(const int32_t peekModes, IgniteError* err);
 
                 /**
                  * Invoke query.
@@ -297,7 +297,7 @@ namespace ignite
                  * @param err Error.
                  * @return Query cursor.
                  */
-                query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, GridError* err);
+                query::QueryCursorImpl* QuerySql(const ignite::cache::query::SqlQuery& qry, IgniteError* err);
 
                 /*
                  * Invoke text query.
@@ -306,7 +306,7 @@ namespace ignite
                  * @param err Error.
                  * @return Query cursor.
                  */
-                query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, GridError* err);
+                query::QueryCursorImpl* QueryText(const ignite::cache::query::TextQuery& qry, IgniteError* err);
 
                 /*
                  * Invoke scan query.
@@ -315,7 +315,7 @@ namespace ignite
                  * @param err Error.
                  * @return Query cursor.
                  */
-                query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, GridError* err);
+                query::QueryCursorImpl* QueryScan(const ignite::cache::query::ScanQuery& qry, IgniteError* err);
                 
             private:
                 /** Name. */
@@ -337,7 +337,7 @@ namespace ignite
                  * @param err Error.
                  * @return Memory pointer.
                  */
-                int64_t WriteTo(interop::InteropMemory* mem, InputOperation& inOp, GridError* err);
+                int64_t WriteTo(interop::InteropMemory* mem, InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Read data from memory.
@@ -355,7 +355,7 @@ namespace ignite
                  * @param err Error.
                  * @return Size.
                  */
-                int SizeInternal(const int32_t peekModes, const bool loc, GridError* err);
+                int SizeInternal(const int32_t peekModes, const bool loc, IgniteError* err);
 
                 /**
                  * Internal out operation.
@@ -365,7 +365,7 @@ namespace ignite
                  * @param err Error.
                  * @return Result.
                  */
-                bool OutOpInternal(const int32_t opType, InputOperation& inOp, GridError* err);
+                bool OutOpInternal(const int32_t opType, InputOperation& inOp, IgniteError* err);
 
                 /**
                  * Internal out-in operation.
@@ -376,7 +376,7 @@ namespace ignite
                  * @param err Error.
                  */
                 void OutInOpInternal(const int32_t opType, InputOperation& inOp, OutputOperation& outOp, 
-                    GridError* err);
+                    IgniteError* err);
 
                 /**
                  * Internal query execution routine.
@@ -386,7 +386,7 @@ namespace ignite
                  * @param err Error.
                  */
                 template<typename T>
-                query::QueryCursorImpl* QueryInternal(const T& qry, int32_t typ, GridError* err)
+                query::QueryCursorImpl* QueryInternal(const T& qry, int32_t typ, IgniteError* err)
                 {
                     ignite::common::java::JniErrorInfo jniErr;
 
@@ -403,7 +403,7 @@ namespace ignite
                     jobject qryJavaRef = env.Get()->Context()->CacheOutOpQueryCursor(javaRef, typ, mem.Get()->PointerLong(), 
                         &jniErr);
 
-                    GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
                     if (jniErr.code == ignite::common::java::IGNITE_JNI_ERR_SUCCESS)
                         return new query::QueryCursorImpl(env, qryJavaRef);

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
index a394383..58c6255 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/cache/query/query_impl.h
@@ -18,7 +18,7 @@
 #ifndef _IGNITE_CACHE_QUERY_IMPL
 #define _IGNITE_CACHE_QUERY_IMPL
 
-#include "ignite/grid_error.h"
+#include "ignite/ignite_error.h"
 #include "ignite/impl/grid_environment.h"
 #include "ignite/impl/operations.h"
 
@@ -55,7 +55,7 @@ namespace ignite
                      * @param err Error.
                      * @return True if exists.
                      */
-                    bool HasNext(GridError* err);
+                    bool HasNext(IgniteError* err);
 
                     /**
                      * Get next object.
@@ -63,7 +63,7 @@ namespace ignite
                      * @param op Operation.
                      * @param err Error.
                      */
-                    void GetNext(OutputOperation& op, GridError* err);
+                    void GetNext(OutputOperation& op, IgniteError* err);
 
                     /**
                      * Get all cursor entries.
@@ -71,7 +71,7 @@ namespace ignite
                      * @param op Operation.
                      * @param err Error.
                      */
-                    void GetAll(OutputOperation& op, GridError* err);
+                    void GetAll(OutputOperation& op, IgniteError* err);
 
                 private:
                     /** Environment. */
@@ -97,7 +97,7 @@ namespace ignite
                      * @param err Error.
                      * @return True in case of success, false if an error is thrown.
                      */
-                    bool CreateIteratorIfNeeded(GridError* err);
+                    bool CreateIteratorIfNeeded(IgniteError* err);
 
                     /**
                      * Check whether Java-side iterator has next element.
@@ -105,7 +105,7 @@ namespace ignite
                      * @param err Error.
                      * @return True if the next element is available.
                      */
-                    bool IteratorHasNext(GridError* err);
+                    bool IteratorHasNext(IgniteError* err);
                 };
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
index c0ad106..0cbcc0a 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/grid_impl.h
@@ -63,7 +63,7 @@ namespace ignite
              * @param err Error.
              */
             template<typename K, typename V> 
-            cache::CacheImpl* GetCache(const char* name, GridError* err)
+            cache::CacheImpl* GetCache(const char* name, IgniteError* err)
             {
                 ignite::common::java::JniErrorInfo jniErr;
 
@@ -71,7 +71,7 @@ namespace ignite
 
                 if (!cacheJavaRef)
                 {
-                    GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
                     return NULL;
                 }
@@ -88,7 +88,7 @@ namespace ignite
              * @param err Error.
              */
             template<typename K, typename V>
-            cache::CacheImpl* GetOrCreateCache(const char* name, GridError* err)
+            cache::CacheImpl* GetOrCreateCache(const char* name, IgniteError* err)
             {
                 ignite::common::java::JniErrorInfo jniErr;
 
@@ -96,7 +96,7 @@ namespace ignite
 
                 if (!cacheJavaRef)
                 {
-                    GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
                     return NULL;
                 }
@@ -113,7 +113,7 @@ namespace ignite
              * @param err Error.
              */
             template<typename K, typename V>
-            cache::CacheImpl* CreateCache(const char* name, GridError* err)
+            cache::CacheImpl* CreateCache(const char* name, IgniteError* err)
             {
                 ignite::common::java::JniErrorInfo jniErr;
 
@@ -121,7 +121,7 @@ namespace ignite
 
                 if (!cacheJavaRef)
                 {
-                    GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
                     return NULL;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
index e3c1955..d8f7883 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_id_resolver.h
@@ -90,7 +90,7 @@ namespace ignite
                 virtual int32_t GetFieldId(const int32_t typeId, const char* name) {
                     if (!name)
                     {
-                        IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "Field name cannot be NULL.");
+                        IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Field name cannot be NULL.");
                     }
 
                     return type.GetFieldId(name);

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
index eb2f445..3e2b770 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_manager.h
@@ -20,7 +20,7 @@
 
 #include <vector>
 
-#include "ignite/grid_error.h"
+#include "ignite/ignite_error.h"
 #include "ignite/impl/portable/portable_metadata_handler.h"
 #include "ignite/impl/portable/portable_metadata_updater.h"
 
@@ -84,7 +84,7 @@ namespace ignite
                  * @param err Error.
                  * @return In case of success.
                  */
-                bool ProcessPendingUpdates(PortableMetadataUpdater* updater, GridError* err);
+                bool ProcessPendingUpdates(PortableMetadataUpdater* updater, IgniteError* err);
 
             private:
                 /** Current snapshots. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
index bd53df6..a734db7 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater.h
@@ -18,7 +18,7 @@
 #ifndef _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
 #define _IGNITE_IMPL_PORTABLE_METADATA_UPDATER
 
-#include "ignite/grid_error.h"
+#include "ignite/ignite_error.h"
 #include "ignite/impl/portable/portable_metadata_snapshot.h"
 
 namespace ignite
@@ -44,7 +44,7 @@ namespace ignite
                  * @param snapshot Snapshot.
                  * @param err Error.
                  */
-                virtual bool Update(Snap* snapshot, GridError* err) = 0;
+                virtual bool Update(Snap* snapshot, IgniteError* err) = 0;
             };
         }
     }    

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
index d03f34b..277cd83 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_metadata_updater_impl.h
@@ -48,7 +48,7 @@ namespace ignite
                  */
                 ~PortableMetadataUpdaterImpl();
 
-                bool Update(Snap* snapshot, GridError* err);
+                bool Update(Snap* snapshot, IgniteError* err);
             private:
                 /** Environment. */
                 ignite::common::concurrent::SharedPointer<GridEnvironment> env;

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
index 119332f..7d82aa2 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/impl/portable/portable_reader_impl.h
@@ -639,7 +639,7 @@ namespace ignite
                     if (hdr == IGNITE_HDR_NULL)
                         return GetNull<T>();
                     else if (hdr == IGNITE_HDR_HND) {
-                        IGNITE_ERROR_1(ignite::GridError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
+                        IGNITE_ERROR_1(ignite::IgniteError::IGNITE_ERR_PORTABLE, "Circular references are not supported.");
                     }
                     else if (hdr == IGNITE_TYPE_PORTABLE)
                     {
@@ -802,7 +802,7 @@ namespace ignite
                             {
                                 int32_t pos = stream->Position();
 
-                                IGNITE_ERROR_FORMATTED_3(GridError::IGNITE_ERR_PORTABLE, "Invalid type ID", 
+                                IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid type ID", 
                                     "position", pos, "expected", expHdr, "actual", typeId)
                             }
                         }
@@ -1031,7 +1031,7 @@ namespace ignite
                     else {
                         int32_t pos = stream->Position() - 1;
 
-                        IGNITE_ERROR_FORMATTED_3(GridError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
+                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
                     }
                 }
 
@@ -1054,7 +1054,7 @@ namespace ignite
                     else {
                         int32_t pos = stream->Position() - 1;
 
-                        IGNITE_ERROR_FORMATTED_3(GridError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
+                        IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", expHdr, "actual", typeId)
                     }
                 }
             };
@@ -1120,7 +1120,7 @@ namespace ignite
                 else {
                     int32_t pos = stream->Position() - 1;
 
-                    IGNITE_ERROR_FORMATTED_3(GridError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
+                    IGNITE_ERROR_FORMATTED_3(IgniteError::IGNITE_ERR_PORTABLE, "Invalid header", "position", pos, "expected", IGNITE_TYPE_STRING, "actual", typeId)
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
index ce5b2fa..fb086ef 100644
--- a/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
+++ b/modules/platform/src/main/cpp/core/include/ignite/portable/portable_type.h
@@ -22,7 +22,7 @@
 
 #include <ignite/common/common.h>
 
-#include "ignite/grid_error.h"
+#include "ignite/ignite_error.h"
 
 /**
  * Start portable type definition.
@@ -147,7 +147,7 @@ namespace ignite
              */
             int32_t GetTypeId()
             {
-                IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "GetTypeId function is not defined for portable type.");
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeId function is not defined for portable type.");
             }
 
             /**
@@ -157,7 +157,7 @@ namespace ignite
              */
             std::string GetTypeName() 
             {
-                IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "GetTypeName function is not defined for portable type.");
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetTypeName function is not defined for portable type.");
             }
 
             /**
@@ -190,7 +190,7 @@ namespace ignite
              */
             void Write(PortableWriter& writer, const T& obj)
             {
-                IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "Write function is not defined for portable type.");
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Write function is not defined for portable type.");
             }
 
             /**
@@ -201,7 +201,7 @@ namespace ignite
              */
             T Read(PortableReader& reader)
             {
-                IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "Read function is not defined for portable type.");
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "Read function is not defined for portable type.");
             }
 
             /**
@@ -222,7 +222,7 @@ namespace ignite
              */
             T GetNull()
             {
-                IGNITE_ERROR_1(GridError::IGNITE_ERR_PORTABLE, "GetNull function is not defined for portable type.");
+                IGNITE_ERROR_1(IgniteError::IGNITE_ERR_PORTABLE, "GetNull function is not defined for portable type.");
             }
         };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
index de90f65..210c8b5 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj
@@ -199,7 +199,7 @@
     <ClInclude Include="..\..\include\ignite\cache\query\query_text.h" />
     <ClInclude Include="..\..\include\ignite\grid.h" />
     <ClInclude Include="..\..\include\ignite\grid_configuration.h" />
-    <ClInclude Include="..\..\include\ignite\grid_error.h" />
+    <ClInclude Include="..\..\include\ignite\ignite_error.h" />
     <ClInclude Include="..\..\include\ignite\grid_factory.h" />
     <ClInclude Include="..\..\include\ignite\guid.h" />
     <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h" />
@@ -235,7 +235,7 @@
   <ItemGroup>
     <ClCompile Include="..\..\os\win\src\impl\utils.cpp" />
     <ClCompile Include="..\..\src\grid.cpp" />
-    <ClCompile Include="..\..\src\grid_error.cpp" />
+    <ClCompile Include="..\..\src\ignite_error.cpp" />
     <ClCompile Include="..\..\src\grid_factory.cpp" />
     <ClCompile Include="..\..\src\guid.cpp" />
     <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
index 5747f10..db21b54 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxproj.filters
@@ -49,7 +49,7 @@
     <ClCompile Include="..\..\src\grid.cpp">
       <Filter>Code</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\grid_error.cpp">
+    <ClCompile Include="..\..\src\ignite_error.cpp">
       <Filter>Code</Filter>
     </ClCompile>
     <ClCompile Include="..\..\src\grid_factory.cpp">
@@ -159,7 +159,7 @@
     <ClInclude Include="..\..\include\ignite\grid_configuration.h">
       <Filter>Code</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\include\ignite\grid_error.h">
+    <ClInclude Include="..\..\include\ignite\ignite_error.h">
       <Filter>Code</Filter>
     </ClInclude>
     <ClInclude Include="..\..\include\ignite\grid_factory.h">

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel b/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
index de90f65..210c8b5 100644
--- a/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
+++ b/modules/platform/src/main/cpp/core/project/vs/core.vcxprojrel
@@ -199,7 +199,7 @@
     <ClInclude Include="..\..\include\ignite\cache\query\query_text.h" />
     <ClInclude Include="..\..\include\ignite\grid.h" />
     <ClInclude Include="..\..\include\ignite\grid_configuration.h" />
-    <ClInclude Include="..\..\include\ignite\grid_error.h" />
+    <ClInclude Include="..\..\include\ignite\ignite_error.h" />
     <ClInclude Include="..\..\include\ignite\grid_factory.h" />
     <ClInclude Include="..\..\include\ignite\guid.h" />
     <ClInclude Include="..\..\include\ignite\impl\cache\cache_impl.h" />
@@ -235,7 +235,7 @@
   <ItemGroup>
     <ClCompile Include="..\..\os\win\src\impl\utils.cpp" />
     <ClCompile Include="..\..\src\grid.cpp" />
-    <ClCompile Include="..\..\src\grid_error.cpp" />
+    <ClCompile Include="..\..\src\ignite_error.cpp" />
     <ClCompile Include="..\..\src\grid_factory.cpp" />
     <ClCompile Include="..\..\src\guid.cpp" />
     <ClCompile Include="..\..\src\impl\cache\cache_impl.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/src/grid_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_error.cpp b/modules/platform/src/main/cpp/core/src/grid_error.cpp
deleted file mode 100644
index e9d075e..0000000
--- a/modules/platform/src/main/cpp/core/src/grid_error.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <ignite/common/java.h>
-
-#include "ignite/impl/utils.h"
-#include "ignite/grid_error.h"
-
-using namespace ignite::common::java;
-using namespace ignite::impl::utils;
-
-namespace ignite
-{
-    void GridError::ThrowIfNeeded(GridError& err)
-    {
-        if (err.code != IGNITE_SUCCESS)
-            throw err;
-    }
-
-    GridError::GridError() : code(IGNITE_SUCCESS), msg(NULL)
-    {
-        // No-op.
-    }
-
-    GridError::GridError(int32_t code) : code(code), msg(NULL)
-    {
-        // No-op.
-    }
-
-    GridError::GridError(int32_t code, const char* msg)
-    {
-        this->code = code;
-        this->msg = CopyChars(msg);
-    }
-
-    GridError::GridError(const GridError& other)
-    {
-        this->code = other.code;
-        this->msg = CopyChars(other.msg);
-    }
-
-    GridError& GridError::operator=(const GridError& other)
-    {
-        if (this != &other)
-        {
-            GridError tmp(other);
-
-            int tmpCode = code;
-            char* tmpMsg = msg;
-            
-            code = tmp.code;
-            msg = tmp.msg;
-
-            tmp.code = tmpCode;
-            tmp.msg = tmpMsg;
-        }
-
-        return *this;
-    }
-
-    GridError::~GridError()
-    {
-        ReleaseChars(msg);
-    }
-
-    int32_t GridError::GetCode()
-    {
-        return code;
-    }
-
-    const char* GridError::GetText()
-    {
-        if (code == IGNITE_SUCCESS)
-            return "Operation completed successfully.";
-        else if (msg)
-            return msg;
-        else
-            return  "No additional information available.";
-    }
-    
-    void GridError::SetError(const int jniCode, const char* jniCls, const char* jniMsg, GridError* err)
-    {
-        if (jniCode == IGNITE_JNI_ERR_SUCCESS)
-            *err = GridError();
-        else if (jniCode == IGNITE_JNI_ERR_GENERIC)
-        {
-            // The most common case when we have Java exception "in hands" and must map it to respective code.
-            if (jniCls)
-            {
-                std::string jniCls0 = jniCls;
-
-                if (jniCls0.compare("java.lang.NoClassDefFoundError") == 0)
-                {
-                    std::stringstream stream; 
-
-                    stream << "Java class is not found (did you set IGNITE_HOME environment variable?)";
-
-                    if (jniMsg)
-                        stream << ": " << jniMsg;
-                    
-                    *err = GridError(IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND, stream.str().c_str());
-                }
-                else if (jniCls0.compare("java.lang.NoSuchMethodError") == 0)
-                {
-                    std::stringstream stream;
-
-                    stream << "Java method is not found (did you set IGNITE_HOME environment variable?)";
-
-                    if (jniMsg)
-                        stream << ": " << jniMsg;
-
-                    *err = GridError(IGNITE_ERR_JVM_NO_SUCH_METHOD, stream.str().c_str());
-                }
-                else if (jniCls0.compare("java.lang.IllegalArgumentException") == 0)
-                    *err = GridError(IGNITE_ERR_ILLEGAL_ARGUMENT, jniMsg);
-                else if (jniCls0.compare("java.lang.IllegalStateException") == 0)
-                    *err = GridError(IGNITE_ERR_ILLEGAL_STATE, jniMsg);
-                else if (jniCls0.compare("java.lang.UnsupportedOperationException") == 0)
-                    *err = GridError(IGNITE_ERR_UNSUPPORTED_OPERATION, jniMsg);
-                else if (jniCls0.compare("java.lang.InterruptedException") == 0)
-                    *err = GridError(IGNITE_ERR_INTERRUPTED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterGroupEmptyException") == 0)
-                    *err = GridError(IGNITE_ERR_CLUSTER_GROUP_EMPTY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterTopologyException") == 0)
-                    *err = GridError(IGNITE_ERR_CLUSTER_TOPOLOGY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeExecutionRejectedException") == 0)
-                    *err = GridError(IGNITE_ERR_COMPUTE_EXECUTION_REJECTED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeJobFailoverException") == 0)
-                    *err = GridError(IGNITE_ERR_COMPUTE_JOB_FAILOVER, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskCancelledException") == 0)
-                    *err = GridError(IGNITE_ERR_COMPUTE_TASK_CANCELLED, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskTimeoutException") == 0)
-                    *err = GridError(IGNITE_ERR_COMPUTE_TASK_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.compute.ComputeUserUndeclaredException") == 0)
-                    *err = GridError(IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION, jniMsg);
-                else if (jniCls0.compare("javax.cache.CacheException") == 0)
-                    *err = GridError(IGNITE_ERR_CACHE, jniMsg);
-                else if (jniCls0.compare("javax.cache.integration.CacheLoaderException") == 0)
-                    *err = GridError(IGNITE_ERR_CACHE_LOADER, jniMsg);
-                else if (jniCls0.compare("javax.cache.integration.CacheWriterException") == 0)
-                    *err = GridError(IGNITE_ERR_CACHE_WRITER, jniMsg);
-                else if (jniCls0.compare("javax.cache.processor.EntryProcessorException") == 0)
-                    *err = GridError(IGNITE_ERR_ENTRY_PROCESSOR, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cache.CacheAtomicUpdateTimeoutException") == 0)
-                    *err = GridError(IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.cache.CachePartialUpdateException") == 0)
-                    *err = GridError(IGNITE_ERR_CACHE_PARTIAL_UPDATE, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionOptimisticException") == 0)
-                    *err = GridError(IGNITE_ERR_TX_OPTIMISTIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionTimeoutException") == 0)
-                    *err = GridError(IGNITE_ERR_TX_TIMEOUT, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionRollbackException") == 0)
-                    *err = GridError(IGNITE_ERR_TX_ROLLBACK, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionHeuristicException") == 0)
-                    *err = GridError(IGNITE_ERR_TX_HEURISTIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteAuthenticationException") == 0)
-                    *err = GridError(IGNITE_ERR_AUTHENTICATION, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException") == 0)
-                    *err = GridError(IGNITE_ERR_SECURITY, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
-                    *err = GridError(IGNITE_ERR_GENERIC, jniMsg);
-                else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") == 0)
-                    *err = GridError(IGNITE_ERR_GENERIC, jniMsg);
-                else
-                {
-                    std::stringstream stream;
-                    
-                    stream << "Java exception occurred [cls=" << jniCls0;
-
-                    if (jniMsg)
-                        stream << ", msg=" << jniMsg;
-
-                    stream << "]";
-
-                    *err = GridError(IGNITE_ERR_UNKNOWN, stream.str().c_str());
-                }                    
-            }
-            else
-            {
-                // JNI class name is not available. Something really weird.
-                *err = GridError(IGNITE_ERR_UNKNOWN);
-            }
-        }
-        else if (jniCode == IGNITE_JNI_ERR_JVM_INIT)
-        {
-            std::stringstream stream;
-
-            stream << "Failed to initialize JVM [errCls=";
-
-            if (jniCls)
-                stream << jniCls;
-            else
-                stream << "N/A";
-
-            stream << ", errMsg=";
-
-            if (jniMsg)
-                stream << jniMsg;
-            else
-                stream << "N/A";
-
-            stream << "]";
-
-            *err = GridError(IGNITE_ERR_JVM_INIT, stream.str().c_str());
-        }
-        else if (jniCode == IGNITE_JNI_ERR_JVM_ATTACH)
-            *err = GridError(IGNITE_ERR_JVM_ATTACH, "Failed to attach to JVM.");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/src/grid_factory.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/grid_factory.cpp b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
index 8fa6d26..b9dcc71 100644
--- a/modules/platform/src/main/cpp/core/src/grid_factory.cpp
+++ b/modules/platform/src/main/cpp/core/src/grid_factory.cpp
@@ -114,23 +114,23 @@ namespace ignite
         return Start(cfg, static_cast<const char*>(NULL));
     }
 
-    Grid GridFactory::Start(const GridConfiguration& cfg, GridError* err)
+    Grid GridFactory::Start(const GridConfiguration& cfg, IgniteError* err)
     {
         return Start(cfg, NULL, err);
     }
 
     Grid GridFactory::Start(const GridConfiguration& cfg, const char* name)
     {
-        GridError err;
+        IgniteError err;
 
         Grid res = Start(cfg, name, &err);
 
-        GridError::ThrowIfNeeded(err);
+        IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    Grid GridFactory::Start(const GridConfiguration& cfg, const char* name, GridError* err)
+    Grid GridFactory::Start(const GridConfiguration& cfg, const char* name, IgniteError* err)
     {
         bool failed = false;
 
@@ -158,7 +158,7 @@ namespace ignite
 
             if (!jvmLibFound)
             {
-                *err = GridError(GridError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
+                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_NOT_FOUND,
                     "JVM library is not found (did you set JAVA_HOME environment variable?)");
 
                 failed = true;
@@ -167,7 +167,7 @@ namespace ignite
             if (!failed) {
                 if (!LoadJvmLibrary(jvmLib))
                 {
-                    *err = GridError(GridError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
+                    *err = IgniteError(IgniteError::IGNITE_ERR_JVM_LIB_LOAD_FAILED, "Failed to load JVM library.");
 
                     failed = true;
                 }
@@ -225,7 +225,7 @@ namespace ignite
 
                 if (!ctx.Get())
                 {
-                    GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                    IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
                     
                     failed = true;
                 }
@@ -251,7 +251,7 @@ namespace ignite
                     ReleaseChars(name0);
 
                     if (!javaRef) {
-                        GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                        IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
                         
                         failed = true;
                     }
@@ -264,7 +264,7 @@ namespace ignite
                 }
             }
             else {
-                *err = GridError(GridError::IGNITE_ERR_JVM_NO_CLASSPATH,
+                *err = IgniteError(IgniteError::IGNITE_ERR_JVM_NO_CLASSPATH,
                     "Java classpath is empty (did you set IGNITE_HOME environment variable?)");
 
                 failed = true;
@@ -293,23 +293,23 @@ namespace ignite
         return Get(static_cast<const char*>(NULL));
     }
 
-    Grid GridFactory::Get(GridError* err)
+    Grid GridFactory::Get(IgniteError* err)
     {
         return Get(NULL, err);
     }
 
     Grid GridFactory::Get(const char* name)
     {
-        GridError err;
+        IgniteError err;
 
         Grid res = Get(name, &err);
 
-        GridError::ThrowIfNeeded(err);
+        IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    Grid GridFactory::Get(const char* name, GridError* err)
+    Grid GridFactory::Get(const char* name, IgniteError* err)
     {
         Grid res;
 
@@ -324,16 +324,16 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
 
-            GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == GridError::IGNITE_SUCCESS)
+            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 // 2. Get environment pointer.
                 long long ptr = ctx.Get()->IgnitionEnvironmentPointer(name0, &jniErr);
 
-                GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-                if (err->GetCode() == GridError::IGNITE_SUCCESS)
+                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
                 {
                     if (ptr != 0)
                     {
@@ -346,7 +346,7 @@ namespace ignite
                         // 4. Get fresh node reference.
                         jobject ref = ctx.Get()->IgnitionInstance(name0, &jniErr);
 
-                        if (err->GetCode() == GridError::IGNITE_SUCCESS) {
+                        if (err->GetCode() == IgniteError::IGNITE_SUCCESS) {
                             if (ref)
                             {
                                 GridImpl* impl = new GridImpl(*env, ref);
@@ -355,14 +355,14 @@ namespace ignite
                             }
                             else
                                 // Error: concurrent node stop.
-                                *err = GridError(GridError::IGNITE_ERR_GENERIC,
+                                *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                                     "Failed to get grid instance because it was stopped concurrently.");
 
                         }
                     }
                     else
                         // Error: no node with the given name.
-                        *err = GridError(GridError::IGNITE_ERR_GENERIC,
+                        *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                             "Failed to get grid instance because it is either not started yet or already stopped.");
                 }
             }
@@ -371,7 +371,7 @@ namespace ignite
         }
         else
             // Error: no node with the given name.
-            *err = GridError(GridError::IGNITE_ERR_GENERIC,
+            *err = IgniteError(IgniteError::IGNITE_ERR_GENERIC,
                 "Failed to get grid instance because it is either not started yet or already stopped.");
 
         factoryLock.Leave();
@@ -384,23 +384,23 @@ namespace ignite
         return Stop(NULL, cancel);
     }
 
-    bool GridFactory::Stop(const bool cancel, GridError* err)
+    bool GridFactory::Stop(const bool cancel, IgniteError* err)
     {
         return Stop(NULL, cancel, err);
     }
 
     bool GridFactory::Stop(const char* name, const bool cancel)
     {
-        GridError err;
+        IgniteError err;
 
         bool res = Stop(name, cancel, &err);
 
-        GridError::ThrowIfNeeded(err);
+        IgniteError::ThrowIfNeeded(err);
 
         return res;
     }
 
-    bool GridFactory::Stop(const char* name, const bool cancel, GridError* err)
+    bool GridFactory::Stop(const char* name, const bool cancel, IgniteError* err)
     {
         bool res = false;
 
@@ -412,9 +412,9 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
 
-            GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == GridError::IGNITE_SUCCESS)
+            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 char* name0 = CopyChars(name);
 
@@ -422,9 +422,9 @@ namespace ignite
 
                 ReleaseChars(name0);
 
-                GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-                if (err->GetCode() == GridError::IGNITE_SUCCESS)
+                if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
                     res = res0;
             }
         }
@@ -436,14 +436,14 @@ namespace ignite
 
     void GridFactory::StopAll(const bool cancel)
     {
-        GridError err;
+        IgniteError err;
 
         StopAll(cancel, &err);
 
-        GridError::ThrowIfNeeded(err);
+        IgniteError::ThrowIfNeeded(err);
     }
 
-    void GridFactory::StopAll(const bool cancel, GridError* err)
+    void GridFactory::StopAll(const bool cancel, IgniteError* err)
     {
         factoryLock.Enter();
 
@@ -453,13 +453,13 @@ namespace ignite
 
             SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr));
              
-            GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+            IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
 
-            if (err->GetCode() == GridError::IGNITE_SUCCESS)
+            if (err->GetCode() == IgniteError::IGNITE_SUCCESS)
             {
                 ctx.Get()->IgnitionStopAll(cancel, &jniErr);
 
-                GridError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
+                IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/863189fd/modules/platform/src/main/cpp/core/src/ignite_error.cpp
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/src/ignite_error.cpp b/modules/platform/src/main/cpp/core/src/ignite_error.cpp
new file mode 100644
index 0000000..65cd291
--- /dev/null
+++ b/modules/platform/src/main/cpp/core/src/ignite_error.cpp
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <ignite/common/java.h>
+
+#include "ignite/impl/utils.h"
+#include "ignite/ignite_error.h"
+
+using namespace ignite::common::java;
+using namespace ignite::impl::utils;
+
+namespace ignite
+{
+    void IgniteError::ThrowIfNeeded(IgniteError& err)
+    {
+        if (err.code != IGNITE_SUCCESS)
+            throw err;
+    }
+
+    IgniteError::IgniteError() : code(IGNITE_SUCCESS), msg(NULL)
+    {
+        // No-op.
+    }
+
+    IgniteError::IgniteError(int32_t code) : code(code), msg(NULL)
+    {
+        // No-op.
+    }
+
+    IgniteError::IgniteError(int32_t code, const char* msg)
+    {
+        this->code = code;
+        this->msg = CopyChars(msg);
+    }
+
+    IgniteError::IgniteError(const IgniteError& other)
+    {
+        this->code = other.code;
+        this->msg = CopyChars(other.msg);
+    }
+
+    IgniteError& IgniteError::operator=(const IgniteError& other)
+    {
+        if (this != &other)
+        {
+            IgniteError tmp(other);
+
+            int tmpCode = code;
+            char* tmpMsg = msg;
+            
+            code = tmp.code;
+            msg = tmp.msg;
+
+            tmp.code = tmpCode;
+            tmp.msg = tmpMsg;
+        }
+
+        return *this;
+    }
+
+    IgniteError::~IgniteError()
+    {
+        ReleaseChars(msg);
+    }
+
+    int32_t IgniteError::GetCode()
+    {
+        return code;
+    }
+
+    const char* IgniteError::GetText()
+    {
+        if (code == IGNITE_SUCCESS)
+            return "Operation completed successfully.";
+        else if (msg)
+            return msg;
+        else
+            return  "No additional information available.";
+    }
+    
+    void IgniteError::SetError(const int jniCode, const char* jniCls, const char* jniMsg, IgniteError* err)
+    {
+        if (jniCode == IGNITE_JNI_ERR_SUCCESS)
+            *err = IgniteError();
+        else if (jniCode == IGNITE_JNI_ERR_GENERIC)
+        {
+            // The most common case when we have Java exception "in hands" and must map it to respective code.
+            if (jniCls)
+            {
+                std::string jniCls0 = jniCls;
+
+                if (jniCls0.compare("java.lang.NoClassDefFoundError") == 0)
+                {
+                    std::stringstream stream; 
+
+                    stream << "Java class is not found (did you set IGNITE_HOME environment variable?)";
+
+                    if (jniMsg)
+                        stream << ": " << jniMsg;
+                    
+                    *err = IgniteError(IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND, stream.str().c_str());
+                }
+                else if (jniCls0.compare("java.lang.NoSuchMethodError") == 0)
+                {
+                    std::stringstream stream;
+
+                    stream << "Java method is not found (did you set IGNITE_HOME environment variable?)";
+
+                    if (jniMsg)
+                        stream << ": " << jniMsg;
+
+                    *err = IgniteError(IGNITE_ERR_JVM_NO_SUCH_METHOD, stream.str().c_str());
+                }
+                else if (jniCls0.compare("java.lang.IllegalArgumentException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ILLEGAL_ARGUMENT, jniMsg);
+                else if (jniCls0.compare("java.lang.IllegalStateException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ILLEGAL_STATE, jniMsg);
+                else if (jniCls0.compare("java.lang.UnsupportedOperationException") == 0)
+                    *err = IgniteError(IGNITE_ERR_UNSUPPORTED_OPERATION, jniMsg);
+                else if (jniCls0.compare("java.lang.InterruptedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_INTERRUPTED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterGroupEmptyException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CLUSTER_GROUP_EMPTY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterTopologyException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CLUSTER_TOPOLOGY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeExecutionRejectedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_EXECUTION_REJECTED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeJobFailoverException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_JOB_FAILOVER, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskCancelledException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_CANCELLED, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.compute.ComputeUserUndeclaredException") == 0)
+                    *err = IgniteError(IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION, jniMsg);
+                else if (jniCls0.compare("javax.cache.CacheException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE, jniMsg);
+                else if (jniCls0.compare("javax.cache.integration.CacheLoaderException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_LOADER, jniMsg);
+                else if (jniCls0.compare("javax.cache.integration.CacheWriterException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_WRITER, jniMsg);
+                else if (jniCls0.compare("javax.cache.processor.EntryProcessorException") == 0)
+                    *err = IgniteError(IGNITE_ERR_ENTRY_PROCESSOR, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cache.CacheAtomicUpdateTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.cache.CachePartialUpdateException") == 0)
+                    *err = IgniteError(IGNITE_ERR_CACHE_PARTIAL_UPDATE, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionOptimisticException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_OPTIMISTIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionTimeoutException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_TIMEOUT, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionRollbackException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_ROLLBACK, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionHeuristicException") == 0)
+                    *err = IgniteError(IGNITE_ERR_TX_HEURISTIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteAuthenticationException") == 0)
+                    *err = IgniteError(IGNITE_ERR_AUTHENTICATION, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException") == 0)
+                    *err = IgniteError(IGNITE_ERR_SECURITY, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
+                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
+                else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") == 0)
+                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
+                else
+                {
+                    std::stringstream stream;
+                    
+                    stream << "Java exception occurred [cls=" << jniCls0;
+
+                    if (jniMsg)
+                        stream << ", msg=" << jniMsg;
+
+                    stream << "]";
+
+                    *err = IgniteError(IGNITE_ERR_UNKNOWN, stream.str().c_str());
+                }                    
+            }
+            else
+            {
+                // JNI class name is not available. Something really weird.
+                *err = IgniteError(IGNITE_ERR_UNKNOWN);
+            }
+        }
+        else if (jniCode == IGNITE_JNI_ERR_JVM_INIT)
+        {
+            std::stringstream stream;
+
+            stream << "Failed to initialize JVM [errCls=";
+
+            if (jniCls)
+                stream << jniCls;
+            else
+                stream << "N/A";
+
+            stream << ", errMsg=";
+
+            if (jniMsg)
+                stream << jniMsg;
+            else
+                stream << "N/A";
+
+            stream << "]";
+
+            *err = IgniteError(IGNITE_ERR_JVM_INIT, stream.str().c_str());
+        }
+        else if (jniCode == IGNITE_JNI_ERR_JVM_ATTACH)
+            *err = IgniteError(IGNITE_ERR_JVM_ATTACH, "Failed to attach to JVM.");
+    }
+}
\ No newline at end of file


Mime
View raw message